Why goto statements Are Considered More Harmful

Andrew Koenig presents facts and analysis to approach the debate about goto statements. goto statements can potentially jump anywhere and destroy any context and scope whatsoever. Whereas its kinscontinue or break have restricted scope and are less harmful. It is quite refreshing to see analytical contribution to a religious debate.

I personally think that goto statements fall in that category that are powerful, but can be easily misused to complicate a program. I find this argument quite similar to the ones against pointers. In both the cases, they require to be used judiciously and carefully. I consider try/catch exception handling to be a modern derivative of the goto mechanism. It seems to be quite popular, but enough misunderstood and misused to be considered harmful in the same vein as goto statements.

Say your thought!

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.



Abhijit Nadgouda
iface Consulting
+91 9819820312
My bookmarks


This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.