From Bell Labs to Modern Compilers: The History of C

UPI Study › Courses › Programming in C › Free lessons › Lesson 2.1 Free with a free account

From Bell Labs to Modern Compilers: The History of C

Programming in C · Chapter 2: C Language Setup, Data Types, Variables, and Console I/OSection 2.1 · lesson 8 of 789 min · free with a free account

← Why ANSI Compliance ExistsNext lesson: Setting Up the C Development Environment →

Earn 3 college credits for Programming in CRecommended for credit by NCCRS · Computer Science 240 · self-paced · one payment, lifetime access

In this lesson

How C grew from Unix at Bell Labs into today's standards.

  • Explain why C was created at Bell Labs to make Unix portable
  • Trace C's history from BCPL and B through K&R C to the ANSI and ISO standards
  • Identify which features arrived in C99, C11, C17 and C23
  • Explain why old K&R-style code can fail on a modern compiler

Free study notes

Get this lesson's notes by email

The key points and 4 practice questions with answers, in your inbox. One email, free.

One email. Unsubscribe in one click.

Transcript

Everything said in the video, section by section (1,189 words). Read along, or search it.

Opening Question

A 1970s Language Still Everywhere

Your phone, your game console, and your home router all run code written in one language. That language is older than most of the people using them. It was built in the early 1970s, by two people at a telephone company's research lab. Part of the reason was simple: they were tired of rewriting an operating system every time they got a new computer. So where did C come from, and why can a program written for it in the 1970s fail on today's compiler?

The Problem

Rewriting Unix for Every Machine

In the late 1960s, Bell Labs, the research lab of the American phone company AT&T, was building an operating system that grew into Unix. An operating system is the main program of a computer. It starts other programs, shares out memory, and talks to the disk and the screen. Early Unix was written in assembly language: the instructions of one particular chip, spelled out in short words. Assembly for one kind of computer means nothing to another kind. Moving Unix to a new machine meant writing it all again. The team wanted something close enough to the hardware to build an operating system, yet readable enough to carry from machine to machine.

Origins

From BCPL to B to C

Ken Thompson wrote a small language called B for this, around 1969 and 1970. B itself grew out of an older language named BCPL. Then Dennis Ritchie took B and improved it. Most importantly, he gave data different types: whole numbers, characters, and more. In the early 1970s, the improved language got the next letter of the alphabet. It became C. Yes, it's a real alphabet joke. B came first, so the one that followed was C.

Turning Point

Unix Rewritten in C in 1973

Then came the move that proved the point. In 1973, Unix was rewritten in C, with only a small part left in assembly. To carry Unix to a different computer, people now wrote a C compiler for that machine and fixed the small part. They didn't rewrite everything. That's the promise of a compiled language: write the idea once, and let a compiler translate it for each machine.

K&R C

A Book, Not a Rulebook

For years, the only description of C was the language as Bell Labs had built it. Then, in 1978, Brian Kernighan and Dennis Ritchie published a book called The C Programming Language. Programmers called it K and R, after the authors' initials, and C as that book described it became K and R C. But a book isn't a rule. It left some things loose, and as C spread, each compiler filled those gaps its own way. A program that worked on one compiler might stumble on another.

Old Code Today

Implicit int No Longer Allowed

Here's a hello program in the loose style of that time. There's no int in front of main, and nothing inside the brackets. Old C let you leave out the int, and quietly assumed one. Priya tries it with today's command. Apple clang refuses, with an error: type specifier missing, defaults to int. It even says why: C99 and later don't allow an implicit int. GCC refuses too, in its own words. The fix is small. Write int main, with void in the brackets, and end with return zero.

Standardization

ANSI in 1989, ISO in 1990

By the 1980s, all those different dialects of C were a real problem. So a committee of the American National Standards Institute, ANSI, wrote an official description of the language. It was approved in 1989. The International Organization for Standardization, ISO, adopted it in 1990. Same language, which is why you'll see C89, C90 and ANSI C. A standard is an agreed rulebook. If a compiler follows it, a correct program means the same thing everywhere.

Revisions

C99, C11, C17 and C23

The rulebook has been revised several times, and each revision keeps old programs working as far as it can. C99 brought short comments with two slashes, the long long whole number, and declaring a variable in the middle of a block. C11 added standard support for threads, running several jobs at once, and removed the dangerous gets function. C17 only fixed mistakes and unclear wording in C11. It added nothing new, which makes it a calm, stable place to learn. It was published in 2018, so you'll also see it called C18. Same standard. And C23, published in 2024, made true and false real keywords. Not every compiler supports all of it yet.

Quick Check

Oldest Standard for Two Features

Quick check. Sam finds a program that puts two-slash comments on its lines, and uses a long long for a lifetime score. His compiler is set to the first official standard, and it rejects the file. What is the oldest standard he could ask for that accepts both? Pause, and decide. C99. Both the two-slash comment and long long arrived in that revision, so it's the oldest that accepts the file. C11 would accept it too, since later standards keep the old features, but it isn't the oldest. And C89 had neither.

Version Check

The Number 201710

Your compiler can tell you which standard it's following. C fills in a name, standard C version, with a number. This program prints it. Compiled with dash s t d equals c 17, it prints 201710: the year and month, October 2017. That date marks C17. So always say which standard you want, as that option does. Without it, a compiler picks its own default, and that default can change when the compiler is updated.

Quick Check

A School Computer Prints 201112

Quick check. Sam runs the same program on a school computer, with no dash s t d option at all. It prints 201112. Which standard is that compiler following by default? Pause, and decide. C11. Read the number as a year and a month: 2011, December. That's the date that marks C11. C17 would print 201710, and C99 a number starting with 1999. It's also why you name the standard yourself.

Why C Survives

Fast, Low-Level and Small

A language from the 1970s should have disappeared by now. C didn't, for three reasons. It's fast, because a C program turns into machine code with very little in between. It reaches right down to memory and the hardware, so you can write the parts other languages are built on. And it's small. There isn't much to learn before you can read almost any C program. So C is the usual choice for operating systems, small devices with little memory, and the engines inside other languages. The Linux kernel and the standard Python interpreter are written mostly in C. So are the SQLite database and the Git tool.

Story Ending

Old Habits, Not Broken Code

Back to the question from the start. Priya finds an old arcade program in a drawer, written long before she was born. Sam compiles it with the C17 command, and gets a wall of errors. Is the program broken? No. It's from the loose K and R days. The language grew up and got stricter. You fix the old habits; you don't blame the code.

Key Takeaways

From Bell Labs to C17

To recap. C grew from BCPL and B at Bell Labs, so that Unix could move between machines. The 1978 K and R book described it, and ANSI and ISO standardized it in 1989 and 1990. C99, C11, C17 and C23 followed. We use C17, and say so with dash s t d equals c 17. Old code can fail today because the rules got stricter, not because it's broken.

About Programming in C at UPI Study

Programming in C (Computer Science 240) is a self-paced online course of 78 video lessons in 11 chapters, from pseudocode and your first program to data types, decisions, loops, functions, arrays, strings, pointers, files, structures, dynamic memory and linked lists. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: C vs C++

Why take it here

Why students take Programming in C with UPI Study

How programs work close to the machineProgramming in C teaches how a program uses memory: variables and data types, control flow, functions, arrays and strings, pointers, files, structures and dynamic memory. C is the base for operating systems, embedded devices and many computer-science courses.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Programming in C carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About From Bell Labs to Modern Compilers: The History of C

Who created the C programming language and why?
Dennis Ritchie created C at Bell Labs in the early 1970s, improving on the B language that Ken Thompson wrote around 1969 and 1970. The team was building Unix, which was first written in assembly language for one particular machine. They wanted a language close enough to the hardware for an operating system but readable enough to move between computers. In 1973, Unix was rewritten mostly in C.
What is K&R C?
K&R C is the early form of C described in the 1978 book The C Programming Language by Brian Kernighan and Dennis Ritchie. For years the book was the main description of the language, but it was not a formal standard, so each compiler filled its gaps in its own way. Some habits of that style, such as leaving out int before main, are rejected by modern compilers in C99 mode or later.
What features did C99 and C11 add to C?
C99 added two-slash comments, the long long integer type, a Boolean type, and declaring variables in the middle of a block. C11 added standard support for threads, which run several jobs at once, and removed the unsafe gets function. C17 added no new features and only fixed mistakes and unclear wording in C11, which makes it a stable standard for learning.
Why does old C code fail to compile with modern compilers?
Old C code often fails because the rules became stricter, not because the code was broken. Early C let programmers leave out the type in front of main, and the compiler assumed int. C99 removed this implicit int, so Clang reports type specifier missing, defaults to int, and recent GCC versions also refuse. The fix is small: write int main(void) and end with return 0;.

About the Programming in C course

How many college credits is Programming in C?
Programming in C (Computer Science 240) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Programming in C cost and what is included?
$250, paid once, with lifetime access: all 78 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Programming in C take?
It is self-paced with no deadlines. The 78 lessons total about 9 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in Programming in C.

78 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Programming in C
3 credits · NCCRS
Enroll →