Brian Kernighan occupies a distinctive place in programming-language
history. He created neither Unix nor
C; those contributions belong
primarily to Ken Thompson and Dennis
Ritchie. His influence came from work
just as durable: building tools around Unix, co-designing specialized
languages, and making the laboratory’s ideas understandable and
reusable.
His name remains associated with AWK, designed with Alfred Aho and
Peter Weinberger, and with The C Programming Language, written with
Ritchie. Ratfor, eqn, pic, AMPL, Unix tools, testing practice, and
decades of teaching reveal a coherent idea: a small language can
simplify a precise task.
Kernighan helped establish a programming culture in which a good tool
does a few things clearly and combines well with others.
From Toronto to Bell Labs
Brian Wilson Kernighan was born in Toronto in 1942. He studied
engineering physics at the University of Toronto and completed a
Princeton doctorate in electrical engineering in 1969 on graph
partitioning. That year he joined Bell Labs’ Computing Science Research
Center.
The laboratory brought together researchers who moved from language
theory to system implementation and documentation. Unix was taking shape
around Thompson and Ritchie. Kernighan tested tools, wrote programs,
improved documentation, and helped turn a local prototype into an
environment others could use.
He is also generally credited with naming Unix, a pun on Multics. The
anecdote reflects his talent for giving technical ideas a compact,
memorable expression.
Unix drew strength not only from its kernel but from programs that read
and wrote simple streams and could be connected by shell pipelines. One
command selected lines, another sorted them, and a third produced a
report.
With Lorinda Cherry, Kernighan developed eqn for describing
mathematical formulas. He also worked on pic for diagrams and on
typesetting systems related to troff. Their specialized notation
described structure while the tool calculated presentation.
Text sources remained readable, editable, archivable, and compatible
with other commands. This approach anticipated documentation as code,
reproducible generation, and dedicated tools inside automated workflows.
Ratfor: improving expression without replacing infrastructure
Older FORTRAN versions made structured
programming awkward. Kernighan created Ratfor—Rational
Fortran—with blocks, loops, and conditions that translated into
Fortran accepted by existing compilers.
Ratfor improved expression while reusing installed infrastructure.
Software Tools, written with P. J. Plauger, used it to show how
portable text-processing utilities could be built rather than merely
presenting finished programs.
The project illustrates a recurring principle: intervene at the most
economical point. A modest preprocessor can sometimes spread a better
practice faster than an entirely new system.
AWK: turning patterns into actions
In 1977, Alfred Aho, Peter Weinberger, and Brian Kernighan designed
AWK, named from their initials. Aho brought expertise in regular
expressions, Weinberger implemented the first version, and Kernighan
pursued a fluid way to process text and numbers together.
The language pairs patterns with actions. It reads records, splits lines
into fields, tests conditions, and performs matching operations.
Traversal and field handling are implicit, so a program states what
varies instead of repeating the processing framework.
AWK occupies the space between a filter and a general-purpose language.
It extracts columns, aggregates measures, converts formats, produces
reports, and validates logs without requiring a compiled C program. Its
balance reflects the collective combination of theory, reporting needs,
pragmatic implementation, and Unix pipeline experience.
K&R: the book that stabilized a way to write C
Dennis Ritchie created C for Unix and its tools. Before formal
standardization, wider adoption required precise explanation, realistic
examples, and a stable account usable by programmers and compiler
authors.
Kernighan and Ritchie published The C Programming Language in 1978.
K&R combined the creator’s knowledge with Kernighan’s teaching
experience, introducing C through short executable programs rather than
isolated definitions.
The first edition became the de facto reference for pre-standard C; the
1988 second edition accompanied ANSI C. The book also spread regular
indentation, focused functions, careful naming, quick testing, and
verifiable examples. Kernighan did not invent C: he helped articulate it
for readers outside Bell Labs.
Explaining the Unix philosophy through practice
With Rob Pike, Kernighan published The Unix Programming Environment in
1984. It taught readers to think with shells, filters, text files, and
composable programs rather than merely listing commands.
Problems were decomposed progressively: start with a command, observe
its limits, then combine tools or design a small language. Kernighan
summarized this culture through principles associated with the Unix
philosophy: programs should do one thing well, cooperate, and use
inspectable formats.
Pipelines have limits. Text can lose structure, errors travel poorly,
and long chains become hard to maintain. The durable lesson is not that
everything must be text, but that simple interfaces and explicit
composition often reduce integration costs.
Small languages for precise problems
Kernighan continued this approach with AMPL, designed with Robert
Fourer and David Gay for mathematical modeling. Users describe
variables, constraints, and objectives without implementing the
numerical solver.
AMPL separates a model from the engine that solves it. Like eqn and
AWK, it captures domain concepts so users do not manually translate them
into low-level operations.
This is the idea of a small language: limited notation with high
expressiveness in a defined area. Query languages, configuration
formats, rule engines, build tools, and visualization notations follow
the same logic, though poor design can accumulate enough exceptions to
exceed an ordinary API’s complexity.
From programming practice to teaching
Kernighan’s books extend his research on tools. The Elements of
Programming Style, with P. J. Plauger, studies real programs; The
Practice of Programming, with Rob Pike, covers design, debugging,
testing, performance, portability, and interfaces.
Their common principle is that style is functional, not decorative.
Readable code exposes assumptions, smaller interfaces limit
dependencies, and systematic tests reduce the risk of change.
Maintaining AWK for decades reinforced this view: widely ported software
encounters unexpected inputs and platforms. Testing clarifies expected
behavior as well as catching regressions. In 2000, Kernighan left Bell
Labs for Princeton, where he teaches computer scientists and
non-specialists.
A history of properly attributed collaborations
Kernighan’s work is inseparable from his collaborators. Ritchie designed
C; Thompson and Ritchie created Unix; Aho, Weinberger, and Kernighan
jointly designed AWK; Fourer and Gay helped create AMPL; Cherry,
Plauger, and Pike made substantial contributions to shared tools and
books.
This precision strengthens his importance. His distinctive skill was
recognizing compatible ideas, building the language or example that
connected them, and explaining them clearly enough for others to reuse.
Bell Labs supported a short loop between design, demanding local use,
correction, and documentation. The tools spread through that cycle of
construction and transmission.
Why Brian Kernighan still matters
Modern ecosystems are far larger than 1970s Unix, yet face the same
choices: add a dependency or write a small tool, design a general format
or a domain language, expose every possibility or preserve a narrow
interface.
Kernighan’s work offers criteria rather than automatic answers: state
the problem clearly, avoid unnecessary machinery, keep data inspectable,
compose autonomous units, and explain behavior through examples readers
can verify.
His legacy is also editorial. Technology spreads not only through
technical merit but through words, examples, and progression that let
outsiders adopt it. K&R did this for C; his other books did it for Unix
and programming practice itself.
Timeline
- 1942: Brian Wilson Kernighan is born in Toronto.
- 1964: He graduates in engineering physics from the University of
Toronto.
- 1969: He completes a Princeton doctorate and joins Bell Labs.
- Early 1970s: He contributes to text-processing tools and the
Unix environment.
- 1975: Ratfor is published.
- 1976: Software Tools is published with P. J. Plauger.
- 1977: AWK is created with Alfred Aho and Peter Weinberger.
- 1978: The first edition of The C Programming Language appears.
- 1984: The Unix Programming Environment is published with Rob
Pike.
- 1988: The second K&R edition covers ANSI C.
- 1980s–1990s: AMPL is developed with Robert Fourer and David
Gay.
- 2000: Kernighan leaves Bell Labs and becomes a Princeton
professor.
- 2019: Unix: A History and a Memoir is published.
- 2023: A second edition of The AWK Programming Language
appears.
Frequently asked questions
Did Brian Kernighan create C?
No. Dennis Ritchie designed C at Bell Labs. Kernighan contributed to its
environment and co-wrote the decisive explanatory work The C
Programming Language with Ritchie.
Who created AWK?
Alfred Aho, Peter Weinberger, and Brian Kernighan created AWK together,
and its name uses their initials. Their expertise in patterns,
implementation, and text-and-number processing jointly shaped it.
What is AWK still used for?
It remains effective for quick transformations of line-and-column data
such as logs, exports, reports, and command output. Nested formats, very
large programs, or extensive library needs may be easier to maintain in
another language.
What is a small language?
It is notation designed for a limited domain, such as AWK’s patterns and
actions, eqn equations, or AMPL optimization models. Specialization
expresses useful concepts with less general machinery.
Why were Kernighan’s books so influential?
They combine compact explanations with realistic, progressive programs.
Rather than merely listing features, they teach methods of design,
testing, and composition that readers can apply to their own tools.