[Edu-sig] Algebra 2

David MacQuigg macquigg at ece.arizona.edu
Mon Oct 6 00:40:46 CEST 2008

The best discussion I have seen on the "Phony GOTO Debate", as Steve McConnell calls it, is in his book "Code Complete", 2nd ed. chapter 17 "Unusual Control Structures".  Without taking sides, he summarizes the arguments for and against, shows examples of really bad code, examples where GOTO is really beneficial, and a final summary of guidelines for using GOTO.

I would try to avoid the topic with beginning students, but if they have already been using BASIC, and have questions like - Where is the GOTO in Python, then it needs to be discussed in a balanced, non-dogmatic way.

This is a forum on education, so it is appropriate to discuss whether and how to present a topic like this, but I hope we don't try to rehash the original debate.  I doubt there is anything more to be said beyond what is in McConnell.

At 06:55 AM 10/4/2008 -0700, michel paul wrote:

>Thanks, it's good to be clear about these things.  I hate perpetuating old myths.
>I'd say that in the context of secondary math classes a good reason to use GOTO would probably never arise?  What I want to do is use programming in these classes in a way that resembles the algebra as much as possible.  As far as I can see, pretty much all of the old BASIC things that would appear in math texts using GOTO can be re-written and made more functional, pun intended.
>On Fri, Oct 3, 2008 at 11:30 PM, Ivan Krstiæ <<mailto:krstic at solarsail.hcs.harvard.edu>krstic at solarsail.hcs.harvard.edu> wrote:
>>On Oct 3, 2008, at 9:22 PM, michel paul wrote:
>>>ever since those days GOTO has been considered bad style.  It produces crazy and cumbersome code.
>>(This generalization is patently incorrect. *Bad* use of GOTO tends to create more spectacular problems in code organization than bad use of a number of other language features, which is why GOTO has earned its reputation. When used correctly, goto is almost a necessity for clean, understandable code in the face of certain flow complexities such as nested loops or multiple "fail, shared cleanup, return" situations within the same function.)
>>Ivan Krstiæ <<mailto:krstic at solarsail.hcs.harvard.edu>krstic at solarsail.hcs.harvard.edu> | http://radian.org

More information about the Edu-sig mailing list