Goto - Common Usage Patterns

Common Usage Patterns

While overall usage of gotos has been declining, there are still situations in some languages where a goto provides the shortest and most straightforward way to express program's logic (while it's possible to express the same logic without gotos, the equivalent code will be longer and often more difficult to understand).

These situations include: multi-level breaks, resource allocation/deallocation, error handling in C language, computed goto in Perl language.

Read more about this topic:  Goto

Famous quotes containing the words common, usage and/or patterns:

    “Down these mean streets a man must go who is not himself mean, who is neither tarnished nor afraid.... He is the hero, he is everything. He must be a complete man and a common man and yet an unusual man. He must be, to use a rather weathered phrase, a man of honor, by instinct, by inevitability, without thought of it, and certainly without saying it. He must be the best man in his world and a good enough man for any world.”
    —Raymond Chandler (1888–1959)

    “...Often the accurate answer to a usage question begins, “It depends.” And what it depends on most often is where you are, who you are, who your listeners or readers are, and what your purpose in speaking or writing is.”
    —Kenneth G. Wilson (b. 1923)

    “The ninety percent of human experience that does not fit into established narrative patterns falls into oblivion.”
    —Mason Cooley (b. 1927)