Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Would you use 'goto' here?

by atcroft (Abbot)
on Dec 06, 2001 at 06:40 UTC ( [id://129836]=note: print w/replies, xml ) Need Help??


in reply to Would you use 'goto' here?

It is important to note that the statement Djikstra made regarding GOTOs was in the late 1960s-a result of studying numerous programs where the use of GOTOs, combined with the relative lack of programming structures, made the code hard to follow, error-prone, and difficult and costly to maintain.

The statement that GOTOs are bad is now taken almost as dogma, but what must be kept in mind is this: if the use of it improves whatever metric you choose to look at, be it read/maintainability in code that must be maintained in production for a lengthy period of time or efficiency in an application where performance is a major issue, then by all means the use of it should be allowed.

Remember that another solution may also exist, though, and may be preferrable, especially if style or style conflicts are an issue, others who must assist in maintaining code have difficulties from their use, or if their use starts to become abusive.

Replies are listed 'Best First'.
Re: Re: Would you use 'goto' here?
by clintp (Curate) on Dec 06, 2001 at 20:20 UTC
    It is important to note that the statement Djikstra made regarding GOTOs was in the late 1960s-a result of studying numerous programs where the use of GOTOs, combined with the relative lack of programming structures, made the code hard to follow, error-prone, and difficult and costly to maintain
    Has anyone gone back and re-done this study in the last 30 years? Are we just repeating things that our forerunners thought was true because we're too lazy to go back and check our facts? Might be worth study.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://129836]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-24 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found