Software Engineering: Crash Course Computer Science #16 — Transcript
Full transcript
- 0:03Hi, I’m Carrie Anne, and welcome to CrashCourse Computer Science!
- 0:05So we’ve talked a lot about sorting in this series and often code to sort a list of numbers
- 0:09might only be ten lines long, which is easy enough for a single programmer to write.
- 0:13Plus, it’s short enough that you don’t need any special tools – you could do it
- 0:16in Notepad.
- 0:17Really!
- 0:18But, a sorting algorithm isn’t a program; it’s likely only a small part of a much
- 0:22larger program.
- 0:23For example, Microsoft Office has roughly 40 millions lines of code.
- 0:2740 MILLION!
- 0:28That’s way too big for any one person to figure out and write!
- 0:32To build huge programs like this, programmers use a set of tools and practices.
- 0:36Taken together, these form the discipline of Software Engineering – a term coined
- 0:40by engineer Margaret Hamilton, who helped NASA prevent serious problems during the Apollo
- 0:44missions to the moon.
- 0:45She once explained it this way: “It’s kind of like a root canal: you waited till
- 0:49the end, [but] there are things you could have done beforehand.
- 0:51It’s like preventative healthcare, but it’s preventative software.”
- 0:55INTRO
- 1:04As I mentioned in episode 12, breaking big programs into smaller functions allows many
- 1:08people to work simultaneously.
- 1:10They don’t have to worry about the whole thing, just the function they’re working on.
- 1:14So, if you’re tasked with writing a sort algorithm, you only need to make sure it sorts
- 1:18properly and efficiently.
- 1:19However, even packing code up into functions isn’t enough.
- 1:22Microsoft Office probably contains hundreds of thousands of them.
- 1:25That’s better than dealing with 40 million lines of code, but it’s still way too many
- 1:29“things” for one person or team to manage.
- 1:31The solution is to package functions into hierarchies, pulling related code together
- 1:35into “objects”.
- 1:36For example, car’s software might have several functions related to cruise control, like
- 1:40setting speed, nudging speed up or down, and stopping cruise control altogether.
- 1:44Since they’re all related, we can wrap them up into a unified cruise control object.
- 1:48But, we don’t have to stop there, cruise control is just one part of the engine’s
- 1:52software.
- 1:53There might also be sets of functions that control spark plug ignition, fuel pumps, and
- 1:56the radiator.
- 1:58So we can create a “parent” Engine Object that contains all of these “children”
- 2:01objects.
- 2:02In addition to children *objects*, the engine itself might have its *own* functions.
- 2:05You want to be able to stop and start it, for example.
- 2:08It’ll also have its own variables, like how many miles the car has traveled.
- 2:12In general, objects can contain other objects, functions and variables.
- 2:15And of course, the engine is just one part of a Car Object.
- 2:18There’s also the transmission, wheels, doors, windows, and so on.
- 2:21Now, as a programmer, if I want to set the cruise control, I navigate down the object
- 2:25hierarchy, from the outermost objects to more and more deeply nested ones.
- 2:29Eventually, I reach the function I want to trigger: “Car, then engine, then cruise
- 2:33control, then set cruise speed to 55”.
- 2:36Programming languages often use something equivalent to the syntax shown here.
- 2:39The idea of packing up functional units into nested objects is called Object Oriented Programming.
- 2:44This is very similar to what we’ve done all series long: hide complexity by encapsulating
- 2:49low-level details in higher-order components.
- 2:52Before we packed up things like transistor circuits into higher-level boolean gates.
- 2:56Now we’re doing the same thing with software.
- 2:57Yet again, it’s a way to move up a new level of abstraction!
- 3:07Breaking up a big program, like a car’s software, into functional units is perfect
- 3:11for teams.
- 3:12One team might be responsible for the cruise control system, and a single programmer on
- 3:16that team tackles a handful of functions.
- 3:19This is similar to how big, physical things are built, like skyscrapers.
- 3:22You’ll have electricians running wires, plumbers fitting pipes, welders welding, painters
- 3:26painting, and hundreds of other people teeming all over the hull.
- 3:29They work together on different parts simultaneously, leveraging their different skills.
- 3:34Until one day, you’ve got a whole working building!
- 3:36But, returning to our cruise control example… its code is going to have to make use of functions
- 3:41in other parts of the engine’s software, to, you know, keep the car at a constant speed.
- 3:45That code isn’t part of the cruise control team’s responsibility.
- 3:48It’s another team’s code.
- 3:49Because the cruise control team didn’t write that, they’re going to need good documentation
- 3:53about what each function in the code does, and a well-defined Application Programming
- 3:57Interface -- or API for short.
- 3:59You can think of an API as the way that collaborating programmers interact across various parts
- 4:04of the code.
- 4:04For example, in the IgnitionControl object, there might be functions to set the RPM of
- 4:08the engine, check the spark plug voltage, as well as fire the individual spark plugs.
- 4:12Being able to set the motor’s RPM is really useful, the cruise control team is going to
- 4:17need to call that function.
- 4:18But, they don’t know much about how the ignition system works.
- 4:21It’s not a good idea to let them call functions that fire the individual spark plugs.
- 4:25Or the engine might explode!
- 4:26Maybe.
- 4:27The API allows the right people access to the right functions and data.
- 4:31Object Oriented Programming languages do this by letting you specify whether functions are
- 4:34public or private.
- 4:36If a function is marked as “private”, it means only functions inside that object
- 4:40can call it.
- 4:41So, in this example, only other functions inside of IgnitionControl, like the setRPM
- 4:45function, can fire the sparkplugs.
- 4:47On the other hand, because the setRPM function is marked as public, other objects can call
- 4:52it, like cruise control.
- 4:54This ability to hide complexity, and selectively reveal it, is the essence of Object Oriented
- 4:58Programming, and it’s a powerful and popular way to tackle building large and complex programs.
- 5:03Pretty much every piece of software on your computer, or game running on your console,
- 5:07was built using an Object Oriented Programming Language, like C++, C# or Objective-C. Other
- 5:12popular “OO” languages you may have heard of are Python and Java.
- 5:15It’s important to remember that code, before being compiled, is just text.
- 5:19As I mentioned earlier, you could write code in Notepad or any old word processor.
- 5:23Some people do.
- 5:24But generally, today’s software developers use special-purpose applications for writing
- 5:28programs, ones that integrate many useful tools for writing, organizing, compiling and
- 5:33testing code.
- 5:34Because they put everything you need in one place, they’re called Integrated Development
- 5:38Environments, or IDEs for short.
- 5:39All IDEs provide a text editor for writing code, often with useful features like automatic
- 5:44color-coding to improve readability.
- 5:46Many even check for syntax errors as you type, like spell check for code.
- 5:50Big programs contain lots of individual source files, so IDEs allow programmers to organize
- 5:54and efficiently navigate everything.
- 5:56Also built right into the IDE is the ability to compile and run code.
- 6:00And if your program crashes, because it’s still a work in progress, the IDE can take
- 6:04you back to the line of code where it happened, and often provide additional information to
- 6:08help you track down and fix the bug, which is a process called debugging.
- 6:11This is important because most programmers spend 70 to 80% of their time testing and
- 6:16debugging, not writing new code.
- 6:18Good tools, contained in IDEs, can go a long way when it comes to helping programmers prevent
- 6:22and find errors.
- 6:23Many computer programmers can be pretty loyal to their IDEs though - but let’s be honest.
- 6:27VIM is where it’s at.
- 6:29Providing you know how to quit.
- 6:30In addition to coding and debugging, another important part of a programmer's job is documenting
- 6:34their code.
- 6:35This can be done in standalone files called “read-me’s” which tell other programmers
- 6:38to read that help file before diving in.
- 6:40It can also happen right in the code itself with comments.
- 6:43These are specially-marked statements that the program knows to ignore when the code
- 6:46is compiled.
- 6:47They exist only to help programmers figure out what’s what in the source code.
- 6:51Good documentation helps programmers when they revisit code they haven’t seen for
- 6:54awhile, but it’s also crucial for programmers who are totally new to it.
- 6:57I just want to take a second here and reiterate that it’s THE WORST when someone parachutes
- 7:02a load of uncommented and undocumented code into your lap, and you literally have to go
- 7:06line by line to understand what the code is doing.
- 7:08Seriously.
- 7:09Don’t be that person.
- 7:10Documentation also promotes code reuse.
- 7:13So, instead of having programmers constantly write the same things over and over, they
- 7:16can track down someone else’s code that does what they need.
- 7:19Then, thanks to documentation, they can put it to work in their program, without ever
- 7:23having to read through the code.
- 7:25“Read the docs” as they say.
- 7:26In addition to IDEs, another important piece of software that helps big teams work collaboratively
- 7:30on big coding projects is called Source Control, also known as version control or revision control.
- 7:36Most often, at a big software company like Apple or Microsoft, code for projects is stored
- 7:40on centralized servers, called a code repository.
- 7:43When a programmer wants to work on a piece of code, they can check it out, sort of like
- 7:47checking out a book out from a library.
- 7:48Often, this can be done right in an IDE.
- 7:51Then, they can edit this code all they want on their personal computer, adding new features
- 7:55and testing if they work.
- 7:56When the programmer is confident their changes are working and there are no loose ends, they
- 8:00can check the code back into the repository, known as committing code, for everyone else
- 8:04to use.
- 8:05While a piece of code is checked out, and presumably getting updated or modified, other
- 8:09programmers leave it alone.
- 8:10This prevents weird conflicts and duplicated work.
- 8:12In this way, hundreds of programmers can be simultaneously checking in and out pieces
- 8:17of code, iteratively building up huge systems.
- 8:19Critically, you don’t want someone committing buggy code, because other people and teams
- 8:23may rely on it.
- 8:25Their code could crash, creating confusion and lost time.
- 8:27The master version of the code, stored on the server, should always compile without
- 8:31errors and run with minimal bugs.
- 8:33But sometimes bugs creep in.
- 8:34Fortunately, source control software keeps track of all changes, and if a bug is found,
- 8:38the whole code, or just a piece, can be rolled back to an earlier, stable version.
- 8:42It also keeps track of who made each change, so coworkers can send nasty, I mean, helpful
- 8:47and encouraging emails to the offending person.
- 8:50Debugging goes hand in hand with writing code, and it’s most often done by an individual
- 8:54or small team.
- 8:55The big picture version of debugging is Quality Assurance testing, or QA.
- 8:59This is where a team rigorously tests out a piece of software, attempting to create
- 9:02unforeseen conditions that might trip it up.
- 9:04Basically, they elicit bugs.
- 9:06Getting all the wrinkles out is a huge effort, but vital in making sure the software works
- 9:10as intended for as many users in as many situations as imaginable before it ships.
- 9:15You’ve probably heard of beta software This is a version of software that’s mostly complete,
- 9:19but not 100% fully tested.
- 9:21Companies will sometimes release beta versions to the public to help them identify issues,
- 9:25it’s essentially like getting a free QA team.
- 9:28What you don’t hear about as much is the version that comes before the beta: the alpha version.
- 9:33This is usually so rough and buggy, it’s only tested internally.
- 9:36So, that’s the tip of the iceberg in terms of the tools, tricks and techniques that allow
- 9:39software engineers to construct the huge pieces of software that we know and love today, like
- 9:44YouTube, Grand Theft Auto 5, and Powerpoint.
- 9:47As you might expect, all those millions of lines of code needs some serious processing
- 9:50power to run at useful speeds, so next episode we’ll be talking about how computers got so incredibly fast.
- 9:56See you then.
About this transcript
This page contains the full transcript of Software Engineering: Crash Course Computer Science #16 by CrashCourse, generated from the public captions YouTube serves with the video. The transcript has 2,012 words across 188 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.