Monday 11 March 2013

A Brief History of C and the Standard




  1. A Brief History of C and the Standard



Until the past few years, no absolute standard for the C language existed. The C
Programming Language, by Kernighan and Richie, served as a standard, but most
compiler manufacturers added extensions and did not follow all the specifications
presented by Kernighan and Richie. As C became one of the most popular computer
languages for programming small computers, the need for a true standard became
apparent.


The American National Standards Institute (ANSI) produced standards that help keep each of the compilers working in the same manner. These standards, which are very exacting, spell out exactly what the language should do and what should not
happen. Specified limits and definitions exist also.

C is an interesting language. Because its syntax is simple, it’s not the most powerful language, and it has only a few operations. Most of C’s power comes from these attributes:

• C can address and manipulate memory by direct address. A program can obtain the memory address of any object (both data objects and functions) and manipulate without restriction the contents of the memory specified by the address. This capability is good to have because it allows flexibility. However, you have no protection from the program overwriting critical parts of the
operating system when you are programming a PC using DOS.


• C has a powerful library of functions. This library of functions enables programmers
to perform I/O, work with strings (which are arrays of characters), and
perform many other tasks.



There is a lot of talk (much I consider to be blown out of proportion) about portability. Generally, for each program, you should consider whether it is likely to be needed on a different system, and how much effort must be dedicated to planning the
move to a future system. Some C programming is never portable. Programs written for Microsoft Windows, for example, don’t move well to the Apple Macintosh or IBM’s
OS/2 Presentation Manager (a system much like Windows). The decision to maintain portability is one that you must make—sometimes the effort to maintain portability
far exceeds what is required if later parts of the program must be rewritten.  



Many of these limits are really compiler limits; however, because they affect the language, you sometimes must take them into consideration. These limits are not usually a problem;
in the ten years that I've been writing C programs, I've run into problems with these limits only once or twice.