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:

    It is a very common error of some unscrupulously infidel-minded, selfish, unprincipled, or downright knavish men, to suppose that believing men, or benevolent-hearted men, or good men, do not know enough to be unscrupulously selfish, do not know enough to be unscrupulous knaves.
    Herman Melville (1819–1891)

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

    Teasing is universal. Anthropologists have found the same fundamental patterns of teasing among New Zealand aborigine children and inner-city kids on the playgrounds of Philadelphia.
    Lawrence Kutner (20th century)