Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Argument starter - The roots of all evil
Message
From
02/09/2004 07:32:13
 
 
To
02/09/2004 06:48:46
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00938079
Message ID:
00938691
Views:
27
SNIP
SNIP
>
>Nowerdays, I can work my way out of any situation where you're tempted to use LOOP, EXIT and intermediate RETURNs, but I recognize it is not always that easy and I can imagine that programmers who have used these kind of constructs for many, many years have more problems in thinking into these solutions. They developed a way of avoiding/minimizing the difficult issues. However in the case of the creator of this thread this was not the case.
>
SNIP

I think you've hit on the main issue here. Please remember that my opening statement in his thread stated "personal preference".
You seem to take some pride in being able to"work my way out of any situation where you're tempted to use LOOP..." and that's fine because you've set that as your personal standard/goal.
But that is no good reason to categorize code that does use them as lousy and hard to read and error prone. As you said, people can write good code or bad code either way.

It is not a way, for those of us who use those constructs, to "way of avoiding/minimizing the difficult issues"... it's simply not an issue. I still cannot see ANY validity to any objection to the use of LOOP/EXIT in otherwise good and functioning code (I sure can see a problem in a 20-screen DO WHILE...).

Readability has little to do with indenting. It has far more to do with clear memvar\object\procedure names. It has far more to do with the sequencing of instructions. It has far more to do with brief comments where helpful. Readability has most relevance during debugging, when there's usually pressure on an individual to get a bug repaired and the system back to work. The concept that repeating any cleanup code is tediuos or leads to bugs is a non-starter as far as fact is concerned, though it might have relevance to personal taste.
I know programmers who delight in using the minimum lines possible and they get itchy when they see some code that could be done in fewer lines. I don't see fewer lines as any kind of benefit myself... especially if it gets a debugger having to think much harder about the code than a few extra lines would do. My personal tendancy is to code as if a novice will be the next person reading/debugging the code.

All in all I think either way works (with or without LOOP/EXIT or multiple returns) and I think it is the quality of the sesign and the surrounding code that is far more material. That is why I participated in this thread - to say categorically that using LOOP/EXIT is not the sign of a bad programmer.

cheers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform