
Beautiful Code
Today's reading has me thinking about "Do-While" loops, as there was one implemented in the code that I was studying. I'm studying them out in PHP as that is the language that I work in. The online PHP manual has been very helpful in providing some effective examples.
There is one key difference between "Do-While" loops and "While" that I have observed. Both loops have a true/false statement to determine whether the loop is to be processed. The distinction between the two is that in a normal "While" loop that check is performed at the beginning of the loop. This makes is so that the first time the statement is checked the return value must be true or else the while loop will not be executed.
On the contrary, with a "Do-While" loop, all scripts inside the loop are executed at least once before the statement is checked. I hope to experiment with this a little more and then report back on how I've found this variation to be helpful.
This example illustrates a quick way of executing a "Do-While" loop without curly brackets.


