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:

    We are the creatures of imagination, passion, and self- will, more than of reason or even of self-interest.... Even in the common transactions and daily intercourse of life, we are governed by whim, caprice, prejudice, or accident. The falling of a teacup puts us out of temper for the day; and a quarrel that commenced about the pattern of a gown may end only with our lives.
    William Hazlitt (1778–1830)

    Pythagoras, Locke, Socrates—but pages
    Might be filled up, as vainly as before,
    With the sad usage of all sorts of sages,
    Who in his life-time, each was deemed a bore!
    The loftiest minds outrun their tardy ages.
    George Gordon Noel Byron (1788–1824)

    I’ve begun to appreciate the generational patterns that ripple out from our lives like stones dropped in water, pulsing outward even after we are gone. Although we have but one childhood, we relive it first through our children’s and then our grandchildren’s eyes.
    Anne Cassidy (20th century)