C
The C programming language is a standardized imperative computer programming language developed in the early 1970s by Dennis Ritchie for use on the Unix operating system. It has since spread to many other operating systems, and is one of the most widely used programming languages. C is prized for its efficiency, and is the most popular programming language for writing system software, though it is also used for writing applications. It is also commonly used in computer science education, despite not being designed for novices.
Philosophy
C is a relatively minimalistic programming language. Among its design goals was that it be straightforwardly compilable by a single pass compiler — that is, that just a few machine language instructions would be required for each of its core language elements, without extensive run-time support. A single pass compiler is one that can compile a source program without having to search backwards in the source file. This is why a prototype is required if a call to a function appears before its definition. It is quite possible to write C code at a low level of abstraction analogous to assembly language; in fact C is sometimes referred to (and not always pejoratively) as "high-level assembly" or "portable assembly".
In part due to its relatively low level and modest feature set, C compilers can be developed comparatively easily. The language has therefore become available on a very wide range of platforms (probably more than for any other programming language in existence). Furthermore, despite its low-level nature, the language was designed to enable (and to encourage) machine-independent programming. A standards compliant and portably written C program can therefore be compiled for a very wide variety of computers.
C was originally developed (along with the Unix operating system with which it has long been associated) by programmers and for programmers, with few users other than its own designers in mind. Nevertheless, it has achieved very widespread popularity, finding use in contexts far beyond its initial systems-programming roots.
C has the following important features:
- A simple core language, with important functionality such as math functions and file handling provided by sets of library routines instead
- Focus on the procedural programming paradigm, with facilities for programming in a structured style
- A type system which prevents many operations that are not meaningful
- Use of a preprocessor language, the C preprocessor, for tasks such as defining macros and including multiple source code files
- Low-level access to computer memory via the use of pointers
- A minimalistic set of keywords
- Parameters that are passed by value. Pass-by-reference semantics may be simulated by explicitly passing pointer values.
- Function pointers and static variables, which allow for a rudimentary form of closures and runtime polymorphism
- Lexical variable scope
- Records, or user-defined aggregate datatypes which allow related data to be combined and manipulated as a whole
