C Character Classification - History

History

Early toolsmiths writing in C under Unix began developing idioms at a rapid rate to classify characters into different types. For example, in the ASCII character set, the following test identifies a letter:

if ('A' <= c && c <= 'Z' || 'a' <= c && c <= 'z')

However, this idiom does not necessarily work for other character sets such as EBCDIC.

Pretty soon, programs became thick with tests such as the one above, or worse, tests almost like the one above. A programmer can write the same idiom several different ways, which slows comprehension and increases the chance for errors.

Before long, the idioms were replaced by the functions in .

Read more about this topic:  C Character Classification

Famous quotes containing the word history:

    My good friends, this is the second time in our history that there has come back from Germany to Downing Street peace with honour. I believe it is peace for our time. We thank you from the bottom of our hearts. And now I recommend you to go home and sleep quietly in your beds.
    Neville Chamberlain (1869–1940)

    To a surprising extent the war-lords in shining armour, the apostles of the martial virtues, tend not to die fighting when the time comes. History is full of ignominious getaways by the great and famous.
    George Orwell (1903–1950)

    There is no history of how bad became better.
    Henry David Thoreau (1817–1862)