Advertisements
All about the C Programming Language
History of C
The C programming language was originally designed for use on the UNIX operating system. C was used to create many UNIX applications, including a C compiler, and was eventually used to write UNIX itself. Its widespread acceptance in the academic arena expanded to include the commercial world, and software vendors such as Microsoft and Borland released C compilers for personal computers. The original Windows API was designed to work with Windows code written in C, and the latest set of the core Windows operating system APIs remain compatible with C to this day.
From a design standpoint, C lacked a detail that other languages such as Smalltalk had already embraced: the concept of an object, a collection of data and a set of operations that can be performed on that data. Object-style coding could be accomplished using C, but the notion of an object was not enforced by the language. If you wanted to structure your code to resemble an object, fine. If you didn't, fine. C really didn't care. Objects weren't an inherent part of the language, so many people didn't pay much attention to this programming paradigm.
After the notion of object-oriented development began to gain acceptance, it became clear that C needed to be refined to embrace this new way of thinking about code. C++ was created to embody this refinement. It was designed to be backwardly compatible with C (such that all C programs would also be C++ programs and could be compiled with a C++ compiler). The major addition to the C++ language was support for the new object concept. The C++ language added support for classes (which are "templates' of objects), and enabled an entire generation of C programmers to think in terms of objects and their behavior.
Year of Creation:
1968 to 1973. C is the oldest of the three languages in this topic and according to the Tiobe.com language comparison, C is still the second most popular language, just behind Java. This is largely due to the number of Unix/Linux systems in existence where C reigns supreme. On Windows, C++ is more popular.
Why was C Invented?
The design goals of C were to provide a simple procedural language for programming Operating Systems, with direct access to memory, a small library, efficient execution and reasonably portability; certainly more so than Assembly Language. It encouraged Structured Programming- a philosophy popular in the 70s where large applications were divided into smaller more manageable pieces.
What was C used for?
One of the earliest applications written in C was Unix. Prior to this, many Operating Systems, including Unix had been written in Assembly Language which restricted their portability.
What Versions of C are there?:
The first version of C was K&R C named after Dennis Ritchie (who invented C) and Brian Kernighan. This was later superseded by Ansi C in 1990. K&R C was a little loose in checking types and parameters of functions and that could lead to unpredictable results and program failures. Because these could lead to memory being overwritten, it was possible for programs to crash the computer they were running on.
Is C Still being Developed?
Several new features were introduced in 1999 - inline functions (like C++), variable length arrays and new types like long long int for 64 bit CPUs but not all compilers support these yet.
Does C present any problems for novice Programmers?
For professional development, maintainability is essential. it is possible to write extremely obtuse code in C. There is even an annual contest for the most Obfuscated code at http://ioccc.org
C has some inconsistencies in syntax. E.g. Pointers and arrays - Pointers are prefixed with a * like *x while arrays are postfixed with [] eg u[]. This simplifies the task of writing confusing code.
How would You sum up C?
C is a powerful programming language, and one of the most popular but it can bite the novice. It is well worth the study as it is arguably the root (syntactically) of many other procedural languages. Learn C and you've learnt the syntax of half a dozen others.