|
Adding more fuel to the fire, Alexi said: >At that time, after aggressive attacks on GOTO usage, it was generally >agreed that GOTO or similar operation is sometimes needed to make a >complicated algorithm more readable and maintainable (there was >classical paper about it by Knuth, if I remember it right). Since GOTO >has become a taboo, ITERATE and LEAVE operations were introduced by some >of the computer science gurus of the time (I do not remember the name). >So, ITERATE and LEAVE operations ARE structured programming by >definition. So real purist will have to accept it. Of course, they have >every right to dislike them personally, but then they will no longer be >purists. My college days are fuzzy for a variety of reasons... but, the one thing I do remember was that the major problem with GOTO was that it allowed the programmer to exit a block of code unconditionally. Unconditional branches are not part of stuctured programming. ITER and LEAVE fall into the unconditional branch catagory as well, and that seems to be a major problem with their usage. They tend to make the code grow horizontally, promoting a monolithic structure. Also, ITER and LEAVE are not self-documenting. It may not be easy to see why ITER is being used at this point, unless comments are included in the code. So, purists may argue with you on this point, Alexi. But, as a practical matter, I've had a few discussions with a few folks off-list regarding ITER/LEAVE and so forth, and the main thread that seems to run through all the conversations has been-- "it's a tool, so if it's used properly, it's OK". I agree, but with serious reservations. Namely, that while I may implement ITER/LEAVE correctly... someone else may not be able to follow my usage of ITER/LEAVE. Or, I'll inherit a program using ITER and LEAVE which uses them improperly. That's the point of having things like standards and structured programming-- not to make a set of rules to which everyone may adhere to blindly, but to make it generally easier for you to develop your own code and for someone else to fix that code. If ITER/LEAVE can be used properly, by all means, do so... just think twice-- some other poor clod out there may not be able to follow your logic, and may have a terrible time with your code. The most embarassing part is when that poor clod happens to be yourself, six months down the road. Look after yerselves... -Doc +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.