Jump to content

Brian Kernighan

From Archania
Brian Kernighan
Institutions Bell Labs, Princeton University
Nationality Canadian
Occupations Computer scientist, Software engineer
Contributions Early contributions to Unix
Notable works The C Programming Language, The Go Programming Language, The Unix Programming Environment
Known for Co-author of The C Programming Language, Co-creator of AWK, Co-creator of AMPL
Wikidata Q92608

Brian Wilson Kernighan (born January 1, 1942) is a Canadian computer scientist whose work has shaped much of modern software programming. He spent three decades (1969–1999) at AT&T’s Bell Laboratories, where he collaborated on the early research and development of the Unix operating system and related software tools. Kernighan is best known as the co-author of The C Programming Language (1978) alongside Dennis Ritchie – a foundational textbook that helped spread the C language worldwide. He also co-created or co-designed several programming languages and tools, including AWK (a scripting language for text processing) and AMPL (a modeling language for mathematical optimization). Later he taught at Princeton University and continued to write influential textbooks (for example on the Go language) and to promote good programming practice. Kernighan’s clear writing style and focus on coding fundamentals made him a leading voice in how generations of programmers learn to write and think about code.

Early life and education

Brian Kernighan was born in Toronto, Canada, in 1942. He attended the University of Toronto, earning a bachelor’s degree in engineering physics in 1964. At that time few people had practical experience with computers; Kernighan did not see his first computer until late in his undergraduate studies. In 1964 he went to graduate school at Princeton University in the then-electric engineering department (computer science was not yet a separate field). He spent three years on a doctorate, completing it in 1969.

During his graduate years, computing technology was rapidly evolving. In the summer of 1966, Kernighan worked at MIT on Project MAC (an early time-sharing computer system), which gave him his first experience with an interactive computing environment rather than slow batch jobs. The next summer (1967), he obtained a summer job at Bell Labs in New Jersey, where many of the future Unix programmers were working on the Multics operating system. He found that the Bell Labs environment was intellectually exciting. He returned to Bell Labs for a second summer in 1968 and there completed research (with colleague Shen Lin) on “graph partitioning,” a problem in dividing networks into parts to minimize cross-connections. This work became Kernighan’s Ph.D. dissertation.

Kernighan thrived at Bell Labs and accepted a permanent position there after earning his Ph.D. in 1969. Over the next 30 years, he would remain at Bell Labs (later AT&T Labs) in New Jersey, moving gradually from mathematical problems into software development and programming research. During this period he observed and participated in key developments: the birth of the Unix operating system (starting in 1969), the creation of the C language (early 1970s), and the spread of a culture of small tools and utilities. He found his niche in explaining and documenting these technologies, drawing on his talent for clear writing. In the late 1970s and 1980s he teamed up with colleagues like Dennis Ritchie, Ken Thompson, Rob Pike, and others to write important books and papers. In 1995 he briefly taught at Harvard, and in 2000 he moved to Princeton University as a professor. At Princeton he taught both advanced computer science courses and an introductory course on computing for non-majors. Kernighan retired formally from Princeton after many years of service, but has remained active in writing and consulting.

Major works and ideas

Kernighan contributed to many influential programming tools, languages, and books. These include actual software he helped write, methods of designing software, and educational materials that taught others. Some of his major contributions are outlined below:

  • The C Programming Language (1978): Kernighan co-authored this classic textbook with Dennis Ritchie, who created C. Often called “Kernighan & Ritchie” or “K&R,” the book was the first widely-available description of C. It laid out the language syntax and semantics in a concise way, using clear example programs. The book’s impact was immense: it helped standardize and spread C around the world. Kernighan later emphasized that he did not design C itself – that was Ritchie’s work – but their book popularized it. (Indeed, Kernighan pointed out that “C is entirely Ritchie’s work,” but that the textbook helped programmers adopt it.) The famous simple program `main() { printf("hello, world\n"); }` appeared as the first example in the book and helped launch the “Hello, World!” tradition for learning programming. The C Programming Language is still regarded as a model of how to write a technical manual and is often cited for its clarity and precision.
  • AWK (1977): AWK is a small, specialized programming language for processing text. Kernighan co-created it at Bell Labs with linguist Alfred Aho and mathematician Peter Weinberger. Its name comes from the first letters of their last names (Aho-Weinberger-Kernighan). AWK was designed in 1977 to make it easy to search and format data from text files, especially on Unix systems. It blurs the line between a programming language and a powerful text-processing command. For example, AWK can treat each line of input as a record and use patterns and actions to extract columns, compute summaries, or reformat output. AWK quickly became a common “glue” or scripting language in the Unix toolkit, useful for solving everyday data-perl tasks like column extraction and report generation. Kernighan and co-authors later wrote The AWK Programming Language (1988) to document AWK in full. AWK’s design emphasized simplicity (e.g., pattern-action pairs, built-in associative arrays) and spawned ideas that influenced other modern scripting languages.
  • AMPL (A Modeling Language for Mathematical Programming): AMPL is a high-level scripting language for describing optimization problems (such as linear or nonlinear programs). Kernighan co-designed AMPL with operations researchers Robert Fourer and David Gay in the 1980s. The idea was to provide a concise language for writing mathematical models (variables, constraints, objectives) that could then be solved by optimization software. Instead of writing code in a general-purpose language like C, a user writes an AMPL “script” that closely resembles the mathematical formulation of the problem. In this way, an economist or engineer can more easily focus on modeling rather than on programming. AMPL became widely used in operations research and academic settings. Kernighan, Fourer, and Gay summarized it in AMPL: A Modeling Language for Mathematical Programming (first published 1993). This work illustrates Kernighan’s pattern of creating languages and tools that let experts in a domain express problems at a high level.
  • Unix and Unix Tools (1970s–80s): Kernighan was part of the community at Bell Labs that built Unix, a pioneering multitasking operating system. While he was not the main architect (that was Ken Thompson and Dennis Ritchie), Kernighan contributed by writing many utility programs and documenting their use. For instance, he wrote ditroff, a family of document-formatting tools. More importantly, he wrote books on how to use Unix. With Rob Pike, he co-wrote The UNIX Programming Environment (1984), which taught programmers how to think in the Unix way: combining small programs (filters) with pipes, using the shell, and leveraging text-processing tools. In this book, Kernighan and Pike emphasized the Unix philosophy of building simple, interoperable programs and explained basic Unix concepts step by step. This work helped spread the Unix style outside of Bell Labs to universities and industry. Their example programs showed how “make”files, shells, and editors could be combined. Kernighan has also been credited with popularizing the term “Unix philosophy”, meaning that systems should do one thing well and chain together cooperatively. (In an aside, Kernighan jokingly coined “What You See Is All You Get” (WYSIAYG) to critique early document editors that threw away hidden formatting, but the main point is in promoting the Unix approach.)
  • Software Tools and “C/Unix Thinking”: In the mid and late 1970s, Kernighan and colleague P. J. Plauger wrote a series of books called Software Tools. These books showed how to implement Unix-style tools (like dictionaries, sorting, etc.) in higher-level languages such as Pascal and later C. The goal was both educational and practical: readers could learn good programming style while also getting a library of useful utilities. For example, their Software Tools in Pascal (1976) and Software Tools in C (1981) taught structured programming and code reuse, by building on simple filter programs and pipelines. Kernighan’s intent was to spread what he called “C/Unix thinking” – meaning the modular, text-and-pipe-oriented approach of Unix – into other computing environments. He even created Ratfor (short for “Rational Fortran”), a preprocessor that let programmers write Fortran code with C-like syntax and control structures; this code was then translated into standard Fortran. These efforts showed Kernighan’s emphasis on methodology: teaching programmers to build robust, modular software by example.
  • Programming Style and Pedagogy: Kernighan has long been interested in how to write good code. In 1974 he co-authored The Elements of Programming Style (with P. J. Plauger), which was inspired by the famous English writing guide The Elements of Style by Strunk and White. Kernighan’s book took pairs of sample programs – one poorly written, one improved – and drew lessons on readability and correctness. This was one of the earliest books specifically about software engineering style. Later, in 1999 he and Rob Pike wrote The Practice of Programming, which discussed best practices (choosing data structures, debugging, testing, notation) beyond any one language. Kernighan’s teaching style (both in books and in classes) stresses rewriting code to improve it. He famously advises programmers to “write code, rewrite it, see it used, and rewrite again.” He also urges reading well-written code (and avoiding reading poor code if possible). In interviews, he has emphasized that the fundamentals – selecting the right algorithm and data structure, thorough testing, and attention to clear notation – never change, even as tools evolve. His pedagogical approach often involves minimal examples and hands-on projects. At Princeton, for example, he taught an advanced project course where students propose and build software with guidance rather than a fixed curriculum; and he taught computing to non-CS majors by connecting technical ideas to everyday examples. In short, Kernighan’s major ideas combine practical programming (small tools, scripting languages) with clear exposition (textbooks, style guides).
  • Algorithms and Theory: In addition to languages, Kernighan contributed to algorithms research. His graduate work on graph partitioning with Shen Lin led to an influential heuristic (now called the Kernighan–Lin algorithm) for dividing a graph into two parts with few crossing edges. They published this around 1970. Unbeknownst to them, this was an example of an NP-hard problem (computationally intractable in the worst case), but their heuristic finds good solutions for many practical cases. A related result (the Lin–Kernighan heuristic) tackled the traveling salesman problem. These contributions show that Kernighan’s interests also spanned theoretical computer science: he explored how to reduce complex problems and devised practical approximations.
  • Go Programming Language (2015): In recent years, Kernighan has been involved in the Go programming language, created at Google by Robert Griesemer, Rob Pike, and Ken Thompson. Kernighan co-authored the official Go textbook The Go Programming Language (2015) with Alan Donovan. Although he did not design Go itself, his role was to help explain and disseminate the language’s concepts. This book provided the first comprehensive reference for Go and thus brought it to a wide audience. His participation underscored how, even late in his career, Kernighan remained active in guiding new languages and teaching them clearly.

Overall, Kernighan’s body of work centers on building simple, powerful programming tools and explaining them well. Whether through creating a new utility or writing a manual, his contributions reflect a commitment to clarity and efficiency in computing. He has said that one should learn many languages (each teaches a different way of thinking), and his own work showcases that breadth – from low-level Unix tools to high-level modeling languages.

Method

Kernighan’s approach to programming and computer science can be described as pragmatic, clear, and iterative. He values writing code that is easy to read and modify, and he encourages a cycle of writing and rewriting. For example, he advises new programmers to experimentally “code, run, observe, fix, and repeat,” believing that learning to program comes from actively doing it and refining one’s code with each iteration. He also stresses the importance of reading good code: by studying well-written examples, a programmer can learn what practices make programs more understandable and reliable. In contrast, he famously notes there is little benefit in reading poorly written code, since it merely shows mistakes to avoid.

Kernighan places a strong emphasis on fundamentals. He often cites selecting the right algorithms and data structures as the first priority when solving any problem. Only after a correct approach is identified does he emphasize careful testing and debugging. He has said that issues like performance tuning and efficient notation (clear variable names, straightforward logic) are perennial concerns, even as languages change. In practice, this means Kernighan focuses on clear, minimal examples – code that says exactly what it needs to, without unnecessary complexity. This mirrors the coding style he champions in his books: short, illustrative programs that teach a lesson without extraneous detail.

Another aspect of his method is modularity and reuse. Reflecting the Unix philosophy, Kernighan designs solutions as a set of small “filters” or tools that can be combined. For instance, AWK itself can be seen as a tiny language for filtering text, and his Software Tools books show how to implement such filters in higher-level languages. By building chains of simple functions (pipeline), a complex task can be handled flexibly. Kernighan advocates using existing tools and libraries whenever possible, so long as they do one thing well.

In teaching, Kernighan’s method is to challenge students and encourage exploration. His project-based computer science course has minimal required topics; instead, students pick interesting problems, build solutions, and present them. This open-ended approach shows trust in creativity and self-directed learning. For non-majors, he uses examples from history, urban life, and current events to make computing relatable. Essentially, he connects abstract concepts to real-world experience in order to motivate learning.

Behind all this is Kernighan’s characteristic modesty about originality. He often downplays being the “inventor” or “maintainer” of things he wrote about. For example, he pointedly said he did not create C, only its documentation. Yet his method – choosing to explain and popularize ideas rather than simply invent them – has been highly effective. He has called himself “not a blazing original” but an “OK writer.” Indeed, much of his work involves translating complex systems into understandable form. Whether writing a textbook or scripting a solution, his method is one of communication: getting ideas across clearly and succinctly.

Influence

Brian Kernighan’s influence on computing has been profound. His textbooks and educational materials have been used by millions of programmers since the 1970s. In particular, The C Programming Language became the de facto standard reference for C programmers worldwide. Many students say it was their first exposure to structured programming concepts. Likewise, The UNIX Programming Environment and the AWK manuals introduced countless people to efficient text manipulation and to the power of Unix. Through these works, Kernighan helped spread Unix and C beyond Bell Labs into academia and industry.

He also helped shape the culture of coding. The notion of the “Hello, World!” program – a minimal sample that prints a greeting – can be traced to the example in the K&R C book; it has since become the traditional first program in many tutorials. Phrases and ideas he popularized, like “one program per small task” (Unix filters) or the importance of good naming, have become part of common lore. His early style guides encouraged programming discipline at a time when few such books existed.

Colleagues and students regard Kernighan as a kind of elder statesman of computer science. He taught courses that bridged disciplines and prepared students for a digital world; for example, his undergraduate course “Computers in Our World” at Princeton covered computing basics for non-technical majors, influencing how universities view computer literacy. Many of his former students have gone on to careers in software and education, carrying Kernighan’s emphasis on clarity with them.

The research community honors Kernighan as well. He is a member of the U.S. National Academy of Engineering and the American Academy of Arts and Sciences, reflecting recognition of his contributions. He received the USENIX Lifetime Achievement (Flame) Award for his decades of work on Unix and programming tools. In 2024 he was given the New Jersey Science & Technology Medal for his contributions to programming languages. These awards highlight how the engineering and academic communities value his role in advancing computing.

Moreover, many prominent computer scientists cite Kernighan as an influence. For instance, Rob Pike (his co-author on the Go book) was a student at Bell Labs; Richard Stallman (founder of GNU) has acknowledged the impact of AWK and Unix; and dozens of others in the programming languages community mention Kernighan’s textbooks as inspiration. His practical wisdom – learned at Bell Labs and Princeton – is often shared in interviews, blogs, and talks (he has given talks on Go, C, and Unix history). The programming world still refers to Kernighan-and-Ritchie C or Kernighan’s style as shorthand for certain idioms.

In everyday terms, Kernighan’s work made many programmers’ lives easier. AWK remains a quick solution for text munging on Unix-like systems (and many administrators still swear by it). C, despite being decades old, is still taught (often via K&R’s text) in systems courses. His legacy includes not just tools but also a mindset of simplicity; programmers trained by his books or classes are often more likely to prefer straightforward solutions. In an era of rapidly changing technology, Kernighan’s focus on fundamentals has kept his influence durable across generations of coders.

Critiques

Brian Kernighan’s work is widely respected, and explicit criticisms of his ideas are relatively rare. Still, as computing has advanced, some observers note limitations or dated aspects of his contributions. For example, the C language (as originally documented by Kernighan and Ritchie) has been criticized for lacking modern safety features: it is low-level and gives the programmer much freedom (and also much responsibility for pointers and memory). Kernighan himself acknowledged this; he often quoted his teacher Peter Norvig who said, "If Python is the Viagra of programming languages, then Kernighan & Ritchie C is the message you get when you call 900-PIAHPER for Viagra." In other words, C is powerful but often surprising because it does little behind the scenes. So critics might say K&R C is too terse or easy to misuse by beginners. However, supporters reply that this was a known trade-off: Kernighan’s goal was clarity in the existing context of the time, and later standards (ANSI C) addressed many safety concerns.

Similarly, AWK is a compact language that has limitations. It lacks some features of general-purpose programming languages (for instance, complex data types and modularity), which means long programs can become unwieldy. By the late 20th century, languages like Perl and Python offered richer text-processing and object-oriented facilities (with more libraries). As a result, some have pointed out that AWK remains mainly useful for short scripts, whereas larger programming work often moved to newer languages. Kernighan and others have responded by improving AWK incrementally (GNU AWK) and noting that AWK still excels in its domain. But it’s fair to say that AWK’s role has narrowed compared to its peak popularity, which some might interpret as a shortcoming of its design scope.

Another area where opinions vary is programming style. The Elements of Programming Style, Kernighan’s early advice book, laid out guidelines like “avoid GOTO,” “use meaningful variable names,” and so on. Many of these rules are considered common sense today or are enforced by modern languages' features. Critics might say that some of Kernighan’s style suggestions were too simplistic or dated (for instance, focusing on pointer usage patterns that were specific to old C). Furthermore, as programming paradigms shifted (to object-oriented or functional styles), some advice from old procedural contexts seems less relevant. Kernighan and his co-authors have acknowledged that style guidance evolves; for example, in later editions they rewrote many examples to match evolving practices. In interviews, Kernighan implied that had he written The Practice of Programming today, he might include new examples but probably not publish a whole new volume unless new fundamental principles emerged.

Finally, some readers have noted that Kernighan’s writing tends to assume readers share the same context. For example, the K&R book is famously terse by not separating declarations from code until the second edition. Beginners have found early editions hard to follow, whereas the current norm is to use function prototypes and strict type checking. Kernighan’s response has been that such evolution was inevitable (and indeed a second edition of the C book and modern compilers resolved many such concerns).

In summary, most “criticisms” of Kernighan’s work are actually reflections of how the field has changed since those works were published. His core ideas – simplicity, clarity, learning by doing – remain uncontroversial. Any critique is usually about style or language features that newer technologies have improved, not about Kernighan’s approach itself. He is generally seen as having set a high standard rather than one to denounce.

Legacy

Today, Brian Kernighan is widely regarded as a key figure in programming history. The generations of programmers and computer scientists who learned from his books and taught computer literacy in the classroom carry forward his influence. His legacy includes both concrete tools (many of which are still in use) and a lasting methodology.

Among his concrete legacies are the languages and utilities he helped popularize. C remains a foundational language for operating systems and embedded programming; AWK is still included in Unix-like systems as a workhorse text-processing tool; AMPL still serves the mathematical optimization community; Go has become a major systems language. Many of his textbooks remain in print decades after first publication. The original K&R C book is still cited and frequently referenced (even as modern successors have taken over, the style “K&R” function declarations appear in code, and the tight control of your program through the single `main` function still reflects the book’s examples).

His style of writing and teaching endures as part of computing education. Phrases like “Hello, World!” and concepts like pipelines of small programs are often credited to Kernighan’s books and talks. Students today often learn programming in introductory courses that trace their lineage to his pedagogy. For instance, many programming courses still start by printing “Hello, world” and analyzing their own code style, a tradition that can be traced back to his influence. His emphasis on learning multiple languages to broaden thinking is echoed in modern computer science curricula.

In Princeton and beyond, Kernighan’s influence is also institutional. He helped build the computer science department culture, serving as director of undergraduate studies for many years. His open-door policy and willingness to advise students across departments made him a beloved mentor. Stories circulate of Kernighan patiently explaining computing to humanities students or staying late fixin code with freshmen. His 2014 book D is for Digital distilled a distilled guide to computing for nonspecialists, reinforcing his commitment to computer literacy.

The historical record of Unix and programming owes much to Kernighan’s chronicling. His 2017 book Unix: A History and a Memoir provides a first-hand account of the Unix saga at Bell Labs. Computer historians and enthusiasts regard it as an important source. Kernighan’s voice in those histories has helped shape how we understand the evolution of software – making sure that not only the technical steps, but the human stories, are remembered.

Finally, Kernighan’s legacy lives on in the spirit he embodied. Those who work in software development often cite his example of curiosity and modesty. He was known for saying things like, “We are software engineers, not gods,” and approached problems with humility. Through interviews and writings, he has conveyed a message that computing is fundamentally a creative, human endeavor – that the goal is to serve people, through clear solutions and effective teaching. In this way, Kernighan’s true legacy may be the generations of software developers who approach their work with the practical wisdom he championed.

Selected Works

  • The Elements of Programming Style (1974, with P. J. Plauger) – Early guide to writing clear, correct code, featuring “bad” and “better” example programs.
  • Software Tools (1976, with P. J. Plauger) – Demonstrated how to build a toolbox of Unix-like utilities in languages such as Pascal, advancing modular programming practices.
  • The C Programming Language (1978, with Dennis Ritchie; 2nd ed. 1988) – Canonical introductory text for the C language that set the standard for C coding.
  • The UNIX Programming Environment (1984, with Rob Pike) – Popular introduction to Unix concepts and utilities, teaching the Unix way of building software.
  • The AWK Programming Language (1988, with Alfred Aho and Peter Weinberger) – Comprehensive manual for AWK, the pattern-scanning language for text data.
  • Software Tools in Pascal (1976, with P. J. Plauger) – Adaptation of the Software Tools concepts for Pascal programmers.
  • Software Tools in C (1981, with P. J. Plauger) – Same as above, but using the C language (helping spread Unix-style programming).
  • AMPL: A Modeling Language for Mathematical Programming (1993, with Robert Fourer and David M. Gay) – Introduced AMPL for describing and solving optimization problems.
  • The Practice of Programming (1999, with Rob Pike) – Offered broad advice on software development (algorithms, testing, debugging, notation) beyond any single language.
  • D is for Digital: What a Computer Scientist Should Know about Computers and Communications (2014) – Presented computing fundamentals and history in an accessible form for a general audience.
  • The Go Programming Language (2015, with Alan A. A. Donovan) – Official textbook and tutorial for Go, a modern systems programming language.
  • Unix: A History and a Memoir (2017) – Personal and technical history of the Unix operating system from one of its early witnesses.

Each of these works is characterized by Kernighan’s drive for clarity and educational value. Together they span the evolution of programming from low-level early systems to contemporary languages, reflecting Kernighan’s lasting impact on how software is built and taught.