Re: Why end for, end if, end while? Here's why I think...
- Posted by jaygade Jul 25, 2008
- 1032 views
bryanso said...
With such nicely indented code a simple end is enough.
Jeremy's example is contrived. If all blocks are whiles:
while complex-condition1 do ... while complex-condition2 do ... while complex-condition3 do ... lengthy code .... end while end while end while
then one can still argue which end while is matching with which while do.
Bryan
Which is why I would use comments in such a case:
while complex-condition1 do ... while complex-condition2 do ... while complex-condition3 do ... lengthy code .... end while -- complex-condition1 end while -- complex-condition2 end while -- complex-condition3