C - the Programming Language Content from the guide to life, the universe and everything

C - the Programming Language

9 Conversations

A computer screen displaying 'Hello World'.

C is possibly the most versatile and widely-used computer programming language ever created. Obscure and sometimes irritatingly concise, C somehow manages to fulfil the needs of tons of talented programmers who know what they want to say and do not wish to use more words than necessary.

C was created by Dennis Ritchie at Bell Labs in 1969. Ritchie, along with Ken Thompson, was involved in creating the first versions of Unix, a powerful operating system for computers with many revolutionary ideas that would change the face of computing forever. Ritchie wanted a language that would be powerful and expressive enough to enable programmers to express complex, abstract, high-level ideas. At the same time, the language would have to be simple and efficient. Soon enough, almost all of Unix itself and the programs many people would use under Unix, including C itself, would be crafted in C, which would suit the task at hand admirably.

C evolved from a previous language Ritchie had created called B, itself a development from BCPL, created a few years previously by Martin Richards at Cambridge. The jury was out for many years as to whether the successor of C would be called D or P (from BCPL), until Bjarne Stroustrup killed off all debate on the issue with his C++.

Why is C so popular, 30 years after its creation1? One reason is the enduring popularity of the Unix operating system; you have to know C pretty well to be able to do just about anything with Unix, and some variant or derivative of Unix. C compilers tend to be simpler than those for other languages, and in the early days, C compilers quickly appeared for all sorts of computers. In 1989, the American National Standards Institute ratified a C standard for all vendors to follow; this was immediately adopted internationally by the International Standards Organisation and by all major compiler vendors.

However, the popularity of C occurred for reasons far beyond mere pragmatics. On a deeper level, C has an enduring appeal for anybody who likes tinkering with computers. C is easy to learn but difficult to master. It can only be mastered by paying careful attention to detail and by repeatedly trying and playing about with little toy programs. C is also fun to program in once you have mastered it - unlike many other languages, where it is very easy to make a start but soon you find they become very irritating the more you use them. C requires more effort to start with, and has a steep learning curve, but C programmers are generally much more productive than any others - and a few lines of C code can often do the work of many more lines of other languages.

It is important to note that although ANSI maintains a standard for C, all compilers need to provide more functionality than just that of the standard. The reason for this is that you can't program effectively using just standard ANSI C. One must use system-based extensions. And so, people all over the world use extensions - Win32 API, POSIX extensions, BSD socket functions, and stuff like that. The upshot is that, although C was intended to be portable, it isn't when extensions aren't incorporated.

It is also true that C is not really appropriate for large-scale programming. C becomes unwieldy when programs are large; it is partly for this reason that C++ was invented. C++ allows a programmer to use object-orientation as an abstraction tool, but still retains almost all of C as a subset. More recently, Java has also moved into this field. But C still remains strong - and is still eminently suitable for numerous programming tasks. Any time you really need speed and efficiency coupled with maintainability, C is usually a good choice.

A very widely-used compiler for C forms one component of the excellent, and free, GNU Compiler Collection2. Of course, it's also written in C.

1Noting that 30 years is a very long time in a field as rapidly developing as computing.2GCC was formerly the GNU C compiler, but is now wider in scope.

Bookmark on your Personal Space


Edited Entry

A425846

Infinite Improbability Drive

Infinite Improbability Drive

Read a random Edited Entry

Categorised In:


Written by

Credits

Edited by

h2g2 Editors

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more