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:

    The wildest dreams of wild men, even, are not the less true, though they may not recommend themselves to the sense which is most common among Englishmen and Americans to-day. It is not every truth that recommends itself to the common sense. Nature has a place for the wild clematis as well as for the cabbage. Some expressions of truth are reminiscent,—others merely sensible, as the phrase is,—others prophetic.
    Henry David Thoreau (1817–1862)

    ...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)

    For the man who should loose me is dead,
    Fighting with the Duke in Flanders,
    In a pattern called a war.
    Christ! What are patterns for?
    Amy Lowell (1874–1925)