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
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Programming in C.
Lesson complete
Earn the 3 college credits for Programming in C
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Setting Up the C Development Environment →← Why ANSI Compliance ExistsNext lesson: Setting Up the C Development Environment →
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.
Enroll now → Course details Download the syllabus All Computer Science courses Every course with PRO →
Compare: C vs C++
Why take it here
Why students take Programming in C with UPI Study
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.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →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?
What is K&R C?
What features did C99 and C11 add to C?
Why does old C code fail to compile with modern compilers?
About the Programming in C course
How many college credits is Programming in C?
How much does Programming in C cost and what is included?
Which universities accept UPI Study credits?
How long does Programming in C take?
How are the exams done?
How do my credits reach my college?
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.
3 credits · NCCRSEnroll →