Computing & Digital Codexery

C (programming language)

The foundational systems programming language that powers operating systems, embedded systems, and more.

Last updated

C is a general-purpose programming language created in 1972 by Dennis Ritchie. By design, C gives programmers relatively direct access to the features of typical CPU architectures, customized for the target instruction set. It has been and continues to be used to implement operating systems (especially kernels), device drivers, and protocol stacks, though its use in application software is decreasing. C is used on computers ranging from supercomputers to microcontrollers and embedded systems.

Ritchie developed C at Bell Labs between 1972 and 1973 as a successor to the B programming language. Its initial purpose was to build utilities for the Unix operating system, and it was later applied to rewriting the Unix kernel itself.

During the 1980s, C gained widespread popularity, becoming one of the most used programming languages, with compilers available for nearly all modern computer architectures and operating systems. The book The C Programming Language, co-authored by Ritchie, served for many years as the de facto language standard. Formal standardization began in 1989 by ANSI, followed by joint ISO and IEC standards.

C is an imperative, procedural language with a free-form source layout. Statements end with semicolons, blocks are grouped with curly braces, and all executable code resides in functions. It supports structured programming, lexical variable scope, recursion, and a static type system. Parameters are passed by value, with pass-by-reference achieved through pointers.

The language provides low-level memory access via pointers, dynamic memory allocation through standard library functions, and a preprocessor for macros and conditional compilation. While C lacks built-in object orientation or garbage collection, these features can be added through external libraries such as GLib Object System and the Boehm garbage collector. Since 2000, C has typically ranked as the most or second-most popular language in the TIOBE index.

Lore & Background

C was initially developed as a successor to the B programming language at Bell Labs by Ritchie between 1972 and 1973. Its initial purpose was to construct utilities running on Unix, and was later applied to re-implementing the kernel of the Unix operating system.

During the 1980s, C gradually gained popularity, leading to it becoming one of the most widely used programming languages, with C compilers available for practically all modern computer architectures and operating systems. The book The C Programming Language, co-authored by the original language designer, served for many years as the de facto standard for the language. C has been standardized since 1989 by the American National Standards Institute (ANSI) and, subsequently, jointly by the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC).

Origins and the Bell Labs Collaboration

The story of The C Programming Language begins at Bell Labs in the early 1970s, where Dennis Ritchie developed C as an augmented evolution of Ken Thompson's earlier B language. The language's development was deeply intertwined with the Unix operating system, which Ritchie himself co-designed.

Brian Kernighan, a fellow Bell Labs employee, had already written the first C tutorial and recognized the need for a proper book-length treatment. He persuaded Ritchie to coauthor a comprehensive text, and the two divided the work naturally: Kernighan handled most of the expository material, while Ritchie contributed his reference manual, which became the book's appendices. This partnership between the language's original designer and a skilled technical writer produced a text that would define how a generation of programmers learned C.

Editions, Standardization, and the Shifting Audience

The authors consciously shifted their audience: where the first edition had been written partly for compiler implementers, the second edition was aimed squarely at programmers. The authors explicitly noted that their appendices were meant for easy comprehension by programmers rather than as a formal definition for compiler writers. Despite several subsequent revisions to the C standard, no new edition of the book has been issued to cover those more recent specifications.

Reception and a Benchmark for Technical Writing

The book's reception was immediate and overwhelmingly positive. Jerry Pournelle, writing in the same magazine that year, called it still the standard while noting it was a bit terse. He acknowledged that one could learn C without the book, but described that path as the hard way, and cautioned against making it the sole C text a programmer owned. Beyond individual reviews, the book has frequently been cited as a model for technical writing, praised for its clear presentation and concise treatment.

The authors themselves emphasized brevity, arguing that C is not a big language and is not well served by a big book. Their examples consisted of complete programs of the type a programmer would encounter in daily system programming work, and all examples were tested directly from the text, which was maintained in machine-readable form. This combination of practicality and precision set a benchmark that subsequent programming texts have struggled to match.

Legacy: Hello World, K&R Style, and Lasting Influence

Perhaps the book's most visible cultural contribution is the Hello, World! program, a minimal working C program that prints only the text hello, world. Introduced as an illustration of the simplest possible program, this example became so ubiquitous that countless subsequent programming language textbooks have adopted the same convention for their introductory chapter. The book's influence on coding practice is equally profound. A generation of programmers who first encountered C in universities and industry absorbed the authors' programming style and conventions as recommended, if not normative, practice.

The specific coding and formatting style of the programs presented in both editions became widely known as K&R style and was adopted by convention in the source code for both the Unix and Linux kernels. Before ANSI C standardization, the first edition functioned as the de facto reference for compiler writers, and even after standardization, the book's treatment of critical features like pointers shaped how programmers understood and used the language. The authors refined their examples across editions, adding programs that convert complicated declarations into words and vice versa, further cementing the text's role as both a teaching tool and a practical reference.

Reader's Guide

C is an imperative procedural language, supporting structured programming, lexical variable scope, and recursion, with a static type system. It was designed to be compiled to provide low-level access to memory and language constructs that map efficiently to machine instructions, all with minimal runtime support. Despite its low-level capabilities, the language was designed to encourage cross-platform programming.

A standards-compliant C program written with portability in mind can be compiled for a wide variety of computer platforms and operating systems with few changes to its source code. Although neither C nor its standard library provide some popular features found in other languages, it is flexible enough to support them. For example, object orientation and garbage collection are provided by external libraries GLib Object System and Boehm garbage collector, respectively.

More in Computing & Digital

Sources

Compiled from Wikipedia and the sources listed below. Text from Wikipedia is available under CC BY-SA 4.0; this entry is adapted from it.

Spotted an error? Know more?

Reader corrections go straight into our review queue. Suggest an edit · How this site is sourced

Comments

Loading…
Open in the interactive codex →