The First Programming Languages: Crash Course Computer Science #11 — Transcript
Full transcript
- 0:03This episode is brought to you by CuriosityStream.
- 0:05Hi, I’m Carrie Anne and welcome to CrashCourse Computer Science!
- 0:08So far, for most of this series, we’ve focused on hardware -- the physical components of
- 0:12computing -- things like: electricity and circuits, registers and RAM, ALUs and CPUs.
- 0:17But programming at the hardware level is cumbersome and inflexible, so programmers wanted a more
- 0:21versatile way to program computers - what you might call a “softer” medium.
- 0:24That’s right, we’re going to talk about Software!
- 0:27INTRO
- 0:36In episode 8, we walked through a simple program for the CPU we designed.
- 0:40The very first instruction to be executed, the one at memory address 0, was 0010 1110.
- 0:46As we discussed, the first four bits of an instruction is the operation code, or OPCODE
- 0:50for short.
- 0:51On our hypothetical CPU, 0010 indicated a LOAD_A instruction -- which moves a value
- 0:57from memory into Register A.
- 0:59The second set of four bits defines the memory location, in this case, 1110, which is 14
- 1:04in decimal.
- 1:05So what these eight numbers really mean is “LOAD Address 14 into Register A”.
- 1:09We’re just using two different languages.
- 1:11You can think of it like English and Morse Code.
- 1:14“Hello” and “.... . .-.. .-.. ---” mean the same thing -- hello! -- they’re just
- 1:19encoded differently.
- 1:20English and Morse Code also have different levels of complexity.
- 1:23English has 26 different letters in its alphabet and way more possible sounds.
- 1:28Morse only has dots and dashes.
- 1:29But, they can convey the same information, and computer languages are similar.
- 1:33As we've seen, computer hardware can only handle raw, binary instructions.
- 1:37This is the “language” computer processors natively speak.
- 1:40In fact, it’s the only language they’re able to speak.
- 1:43It’s called Machine Language or Machine Code.
- 1:45In the early days of computing, people had to write entire programs in machine code.
- 1:49More specifically, they’d first write a high-level version of a program on paper,
- 1:53in English, for example...
- 1:55“retrieve the next sale from memory, then add this to the running total for the day,
- 1:59week and year, then calculate any tax to be added”
- 2:02...and so on.
- 2:03An informal, high-level description of a program like this is called Pseudo-Code.
- 2:06Then, when the program was all figured out on paper, they’d painstakingly expand and
- 2:10translate it into binary machine code by hand, using things like opcode tables.
- 2:15After the translation was complete, the program could be fed into the computer and run.
- 2:19As you might imagine, people quickly got fed up with this process.
- 2:21So, by the late 1940s and into the 50s, programmers had developed slightly higher-level languages
- 2:26that were more human-readable.
- 2:28Opcodes were given simple names, called mnemonics, which were followed by operands, to form instructions.
- 2:33So instead of having to write instructions as a bunch of 1’s and 0’s, programmers
- 2:37could write something like “LOAD_A 14”.
- 2:40We used this mnemonic in Episode 8 because it’s so much easier to understand!
- 2:43Of course, a CPU has no idea what “LOAD_A 14” is.
- 2:46It doesn’t understand text-based language, only binary.
- 2:49And so programmers came up with a clever trick.
- 2:51They created reusable helper programs, in binary, that read in text-based instructions,
- 2:56and assemble them into the corresponding binary instructions automatically.
- 3:00This program is called -- you guessed it -- an Assembler.
- 3:02It reads in a program written in an Assembly Language and converts it to native machine
- 3:07code.
- 3:07“LOAD_A 14” is one example of an assembly instruction.
- 3:10Over time, Assemblers gained new features that made programming even easier.
- 3:14One nifty feature is automatically figuring out JUMP addresses.
- 3:18This was an example program I used in episode 8:Notice how our JUMP NEGATIVE instruction
- 3:22jumps to address 5, and our regular JUMP goes to address 2.
- 3:25The problem is, if we add more code to the beginning of this program, all of the addresses
- 3:29would change.
- 3:30That’s a huge pain if you ever want to update your program!
- 3:32And so an assembler does away with raw jump addresses, and lets you insert little labels
- 3:37that can be jumped to.
- 3:38When this program is passed into the assembler, it does the work of figuring out all of the
- 3:41jump addresses.
- 3:42Now the programmer can focus more on programming and less on the underlying mechanics under
- 3:46the hood enabling more sophisticated things to be built by hiding unnecessary complexity.
- 3:51As we’ve done many times in this series, we’re once again moving up another level
- 3:55of abstraction.
- 3:56A NEW LEVEL OF ABSTRACTION!
- 4:02However, even with nifty assembler features like auto-linking JUMPs to labels, Assembly
- 4:07Languages are still a thin veneer over machine code.
- 4:09In general, each assembly language instruction converts directly to a corresponding machine
- 4:14instruction – a one-to-one mapping – so it’s inherently tied to the underlying hardware.
- 4:18And the assembler still forces programmers to think about which registers and memory
- 4:22locations they will use.
- 4:24If you suddenly needed an extra value, you might have to change a lot of code to fit
- 4:27it in.
- 4:28Let’s go to the Thought Bubble.
- 4:29This problem did not escape Dr. Grace Hopper.
- 4:32As a US naval officer, she was one of the first programmers on the Harvard Mark 1 computer,
- 4:37which we talked about in Episode 2.
- 4:38This was a colossal, electro-mechanical beast completed in 1944 as part of the allied war effort.
- 4:44Programs were stored and fed into the computer on punched paper tape.
- 4:47By the way, as you can see, they “patched” some bugs in this program by literally putting
- 4:51patches of paper over the holes on the punch tape.
- 4:54The Mark 1’s instruction set was so primitive, there weren’t even JUMP instructions.
- 4:58To create code that repeated the same operation multiple times, you’d tape the two ends
- 5:02of the punched tape together, creating a physical loop.
- 5:05In other words, programming the Mark 1 was kind of a nightmare!
- 5:08After the war, Hopper continued to work at the forefront of computing.
- 5:12To unleash the potential of computers, she designed a high-level programming language
- 5:15called “Arithmetic Language Version 0”, or A-0 for short.
- 5:19Assembly languages have direct, one-to-one mapping to machine instructions.
- 5:23But, a single line of a high-level programming language might result in dozens of instructions
- 5:27being executed by the CPU.
- 5:29To perform this complex translation, Hopper built the first compiler in 1952.
- 5:34This is a specialized program that transforms “source” code written in a programming
- 5:38language into a low-level language, like assembly or the binary “machine code” that the
- 5:42CPU can directly process.
- 5:44Thanks, Thought Bubble.
- 5:45So, despite the promise of easier programming, many people were skeptical of Hopper’s idea.
- 5:50She once said, “I had a running compiler and nobody would touch it.
- 5:54… they carefully told me, computers could only do arithmetic; they could not do programs.”
- 5:58But the idea was a good one, and soon many efforts were underway to craft new programming
- 6:03languages -- today there are hundreds!
- 6:04Sadly, there are no surviving examples of A-0 code, so we’ll use Python, a modern
- 6:09programming language, as an example.
- 6:10Let’s say we want to add two numbers and save that value.
- 6:14Remember, in assembly code, we had to fetch values from memory, deal with registers, and
- 6:18other low-level details.
- 6:19But this same program can be written in python like so:
- 6:22Notice how there are no registers or memory locations to deal with -- the compiler takes
- 6:25care of that stuff, abstracting away a lot of low-level and unnecessary complexity.
- 6:29The programmer just creates abstractions for needed memory locations, known as variables,
- 6:34and gives them names.
- 6:35So now we can just take our two numbers, store them in variables we give names to -- in this
- 6:40case, I picked a and b but those variables could be anything - and then add those together,
- 6:45saving the result in c, another variable I created.
- 6:47It might be that the compiler assigns Register A under the hood to store the value in a,
- 6:52but I don’t need to know about it!
- 6:54Out of sight, out of mind!
- 6:55It was an important historical milestone, but A-0 and its later variants weren’t widely used.
- 7:01FORTRAN, derived from "Formula Translation", was released by IBM a few years later, in
- 7:061957, and came to dominate early computer programming.
- 7:08John Backus, the FORTRAN project director, said: "Much of my work has come from being
- 7:12lazy.
- 7:13I didn't like writing programs, and so ... I started work on a programming system to make
- 7:17it easier to write programs."
- 7:19You know, typical lazy person.
- 7:21They’re always creating their own programming systems.
- 7:23Anyway, on average, programs written in FORTRAN were 20 times shorter than equivalent handwritten
- 7:27assembly code.
- 7:28Then the FORTRAN Compiler would translate and expand that into native machine code.
- 7:32The community was skeptical that the performance would be as good as hand written code, but
- 7:36the fact that programmers could write more code more quickly, made it an easy choice
- 7:40economically: trading a small increase in computation time for a significant decrease
- 7:45in programmer time.
- 7:46Of course, IBM was in the business of selling computers, and so initially, FORTRAN code
- 7:50could only be compiled and run on IBM computers.
- 7:53And most programing languages and compilers of the 1950s could only run on a single type
- 7:57of computer.
- 7:58So, if you upgraded your computer, you’d often have to re-write all the code too!
- 8:02In response, computer experts from industry, academia and government formed a consortium
- 8:06in 1959 -- the Committee on Data Systems Languages, advised by our friend Grace Hopper -- to guide
- 8:12the development of a common programming language that could be used across different machines.
- 8:16The result was the high-level, easy to use, Common Business-Oriented Language, or COBOL
- 8:20for short.
- 8:21To deal with different underlying hardware, each computing architecture needed its own
- 8:24COBOL compiler.
- 8:25But critically, these compilers could all accept the same COBOL source code, no matter
- 8:30what computer it was run on.
- 8:31This notion is called write once, run anywhere.
- 8:33It’s true of most programming languages today, a benefit of moving away from assembly
- 8:37and machine code, which is still CPU specific.
- 8:40The biggest impact of all this was reducing computing’s barrier to entry.
- 8:44Before high level programming languages existed, it was a realm exclusive to computer experts
- 8:48and enthusiasts.
- 8:49And it was often their full time profession.
- 8:51But now, scientists, engineers, doctors, economists, teachers, and many others could incorporate
- 8:56computation into their work .
- 8:58Thanks to these languages, computing went from a cumbersome and esoteric discipline
- 9:02to a general purpose and accessible tool.
- 9:04At the same time, abstraction in programming allowed those computer experts – now “professional
- 9:08programmers” – to create increasingly sophisticated programs, which would have taken
- 9:12millions, tens of millions, or even more lines of assembly code.
- 9:16Now, this history didn’t end in 1959.
- 9:18In fact, a golden era in programming language design jump started, evolving in lockstep
- 9:22with dramatic advances in computer hardware.
- 9:25In the 1960s, we had languages like ALGOL, LISP and BASIC.
- 9:28In the 70’s: Pascal, C and Smalltalk were released.
- 9:31The 80s gave us C++, Objective-C, and Perl.
- 9:34And the 90’s: python, ruby, and Java.
- 9:36And the new millennium has seen the rise of Swift, C#, and Go - not to be confused with
- 9:40Let it Go and Pokemon Go.
- 9:42Anyway, some of these might sound familiar -- many are still around today.
- 9:45It’s extremely likely that the web browser you’re using right now was written in C++
- 9:49or Objective-C.
- 9:50That list I just gave is the tip of the iceberg.
- 9:53And languages with fancy, new features are proposed all the time.
- 9:56Each new language attempts to leverage new and clever abstractions to make some aspect
- 10:00of programming easier or more powerful, or take advantage of emerging technologies and
- 10:03platforms, so that more people can do more amazing things, more quickly.
- 10:07Many consider the holy grail of programming to be the use of “plain ol’ English”,
- 10:10where you can literally just speak what you want the computer to do, it figures it out,
- 10:14and executes it.
- 10:15This kind of intelligent system is science fiction… for now.
- 10:18And fans of 2001: A Space Odyssey may be okay with that.
- 10:21Now that you know all about programming languages, we’re going to deep dive for the next couple
- 10:25of episodes, and we’ll continue to build your understanding of how programming languages,
- 10:29and the software they create, are used to do cool and unbelievable things.
- 10:33See you next week.
- 10:34Hey guys, this week’s episode was brought to you by CuriosityStream which is a streaming
- 10:39service full of documentaries and nonfiction titles from some really great filmmakers,
- 10:43including exclusive originals.
- 10:45I just watched a great series called “Digits” hosted by our friend Derek Muller.
- 10:49It’s all about the Internet - from its origins, to the proliferation of the Internet of Things,
- 10:53to ethical, or white hat, hacking.
- 10:55And it even includes some special guest appearances… like that John Green guy you keep mentioning
- 11:00in the comments.
- 11:01And Curiosity Stream offers unlimited access starting at $2.99 a month, and for you guys,
- 11:07the first two months are free if you sign up at curiositystream.com/crashcourse
- 11:12and use the promo code "crash course" during the sign-up process.
About this transcript
This page contains the full transcript of The First Programming Languages: Crash Course Computer Science #11 by CrashCourse, generated from the public captions YouTube serves with the video. The transcript has 2,187 words across 204 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.