C Programming/Why learn C?
From Wikibooks, the open-content textbooks collection
C is the most commonly used programming language for writing operating systems. Unix was the first operating system written in C. Later Microsoft Windows, Mac OS X, and GNU/Linux were all written in C.
Not only is C the language of operating systems, it is the precursor and inspiration for almost all of the most popular high-level languages available today. In fact, Perl, PHP, Python, and Ruby are all written in C.
By way of analogy, let's say that you were going to be learning Spanish, Italian, French, or Portuguese. Do you think knowing Latin would be helpful? Just as Latin was the basis of all of those languages, knowing C will enable you to understand and appreciate an entire family of programming languages built upon the traditions of C. Knowledge of C enables freedom.
[edit] Why C, and not assembly language?
Because Assembly, while extremely powerful, is simply too difficult to program large applications and hard to read or interpret in a logical way. Additionally, different processors are programmed using different Assembly languages and having to choose and learn only one of them is too arbitrary. In fact, one of the strengths of C is its universality and portability across various computer architectures.
One powerful reason is that of memory allocation. Unlike most computer languages, C allows the programmer to write directly on memory in an machine-independent fashion. Languages like Java and Perl shield the programmer from having to worry about memory allocation and pointers. This is usually a good thing, since dealing with memory allocation when building a high-level program is a highly error-prone process. However, when dealing with low level code such as the part of the OS that controls a device, C provides a uniform, clean interface. These capabilities just do not exist in other languages such as Java. Also, C is a compiled language, which creates fast and efficient executable files.
So is it any wonder that C is such a popular language?
Like toppling dominoes, the next generation of programs follows the trend of its ancestors. Operating systems designed in C always have system libraries designed in C. Those system libraries are in turn used to create higher-level libraries (like OpenGL, or GTK), and the designers of those libraries often decide to use the language the system libraries used. Application developers use the higher-level libraries to design word processors, games, media players and the like. Many of them will choose to program in the language that higher-level library uses. And the pattern continues on and on and on...
[edit] Why C, and not another high-level language?
While Perl, PHP, Python and Ruby may be powerful and support many features not provided by default in C, they are not normally implemented in their own language. Rather, most such languages initially relied on being written in C (or another high-performance programming language).
The primary design of C is to produce portable code while maintaining performance and minimizing footprint, as is the case for operating systems or other programs where a "high-level" interface would affect performance. It is a stable and mature language whose features are unlikely to disappear for a long time and has been ported to most, if not all, platforms.
As with all programming languages, whether you want to choose C over another high-level language is a matter of opinion and both technical and business requirements.