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:

    They are a sort of post-house,where the Fates
    Change horses, making history change its tune,
    Then spur away o’er empires and o’er states,
    Leaving at last not much besides chronology,
    Excepting the post-obits of theology.
    George Gordon Noel Byron (1788–1824)

    Systematic philosophical and practical anti-intellectualism such as we are witnessing appears to be something truly novel in the history of human culture.
    Johan Huizinga (1872–1945)

    Tell me of the height of the mountains of the moon, or of the diameter of space, and I may believe you, but of the secret history of the Almighty, and I shall pronounce thee mad.
    Henry David Thoreau (1817–1862)