+ 2
why do many professional programmers avoid while loops when possible?
opinionated question involving preference and infinity.
4 odpowiedzi
+ 4
I should say, you are wrong, the professional programmers use loops allways when is possible, and the -while- where is it suitable. This is the answer, there is several types of loops and every is suitable for some type of algorytmus..
+ 2
Use a generator. It's like splitting an instantaneous function into pieces [with state retention] so you can watch it run, without all the mucking about running out of memory.
+ 2
Infinite loops can make your entire program run slowly, because they are constant. There are other reasons, but that one seems to be the most likely solution.
0
any programmer cant avoid while loops!