Почему считается плохой практикой использовать флаги в коде? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Почему считается плохой практикой использовать флаги в коде?

То есть, если я задал условие и оно выдало неподходящий вариант, почему я не могу просто вернуться в коде через эти флажки? Я, конечно, мог бы записать код по другому, через цыкл, но зачем? (я не уверен, что их называют флагами)

13th Aug 2017, 12:30 PM
Alexik
Alexik - avatar
2 Antworten
+ 8
translation : Why is it bad practice to use flags in the code? That is, if I set a condition and it gave an unsuitable option, why can not I just return to the code through these flags? I, of course, could write the code differently, through the word, but why? (I'm not sure that they are called flags)
13th Aug 2017, 12:41 PM
Ranjan Bagri
Ranjan Bagri - avatar
+ 1
@ #00FF00, Very thanks :)
13th Aug 2017, 12:44 PM
Alexik
Alexik - avatar