Q&A
MIT 6.NULL The Missing Semester of Your CS Education, lecture 11, explained in plain English
Want this lecture to stick? In LessonBound you get checked practice questions for every part, can ask about anything you don't get, and can listen with your screen off. Free, no ads.
Learn this lecture freeWatch or read the original lecture: MIT OpenCourseWare.
Part 1
This part explains which tools to use for scripts, how your computer finds programs, how to install software safely, and how to find slow spots in your code.
Key ideas
- Bash is good for short, simple scripts that run a few commands. For bigger programs, Python or Ruby is easier to get right and reuse, because bash has no software libraries.
- Running 'source script.sh' runs the commands in your current terminal session, so changes like changing folders stay. Running './script.sh' starts a new session, so those changes disappear when it ends.
- Your terminal finds programs by searching the folders listed in your PATH setting. The 'which' or 'type' command shows where a program is coming from.
- The lecture recommends using a language's own package manager when you can, and an isolated environment such as Python's virtualenv, so libraries for different projects do not clash.
- The simplest way to find slow code is print timing: measure the time between parts of your code and narrow down the slowest section. Callgrind gives more detail but makes your program much slower.
Words to know
- PATH
- A setting that lists the folders your terminal searches when you type the name of a program.
- source
- A bash command that runs a script inside your current terminal session, so its changes stay after it finishes.
- virtual environment
- A separate, private set of installed libraries for one project, so it does not interfere with other projects.
- profiling
- Measuring how long different parts of your program take, so you can find the parts that are slow.
Example
Think of running a script with source as asking a helper to rearrange the furniture in your own room, so the changes stay. Running ./script.sh is like giving the helper a copy of the room to rearrange, so your real room stays the same when they leave.
3 checked practice questions for this part are in the app.
Part 2
This part covers tools for finding slow code, how containers differ from virtual machines, how Linux distributions handle updates, and tips for data and machine learning work.
Key ideas
- A sampling profiler checks what your program is doing many times while it runs, and a flamegraph is a picture that makes that data easy to read. Each language often has its own profiler, and web browsers have built-in ones.
- Sometimes code is slow because it is waiting for something, like a disk read or a network packet. In that case, compare what the hardware should be able to do with the speeds you actually measure.
- A container shares the kernel (the core part of the operating system) with the computer it runs on. A virtual machine runs its own full copy of the operating system, so it has more overhead (extra work and resource use) but stronger isolation.
- Linux distributions differ mostly in how they release updates. Rolling-update systems like Arch get new features quickly but may break now and then, while conservative systems like Debian or Ubuntu LTS are more stable but get new features later.
- In machine learning, you run many experiments, so logging each run's settings to a simple JSON file lets you use command-line tools to search and compare them later.
Words to know
- kernel
- The core part of an operating system. It controls the computer's hardware and manages how programs use it.
- containers
- Isolated environments that let a program run as if it has its own computer, while really sharing the hardware and kernel of the host machine.
- sampling profiler
- A tool that checks what a running program is doing again and again, so you can see where it spends most of its time.
- rolling update policy
- A way of releasing software where new versions arrive constantly. You get the newest features quickly, but things can break more often.
Example
Think of a shared apartment building versus separate houses. Apartments share the building's foundation and utilities, which saves cost and space, just as containers share the host's kernel. Separate houses each have their own foundation, which is heavier but keeps each home more fully separate, like a virtual machine.
3 checked practice questions for this part are in the app.
Part 3
This part covers useful Vim editor tricks for moving around and undoing changes, plus short notes on two-factor login and web browsers.
Key ideas
- Vim has plugins, which are add-on programs that add features or fix things Vim lacks. Good places to find them are VimAwesome and other programmers' dotfiles (the setup files they keep for their editors).
- Marks let you save a spot in a file with m and a letter, then jump back to it with '. You can use this to move quickly within a file or between files.
- Vim keeps a tree of your changes, not just a single line of them. So even after you undo and make a different change, you can still get back to the original version.
- Persistent undo is a built-in feature that is off by default. When you turn it on, Vim saves each file's undo history, so you can still undo changes after closing and reopening Vim.
- Two-factor authentication (2FA) asks for a password plus proof that you have a hardware device. The lesson recommends a U2F device such as a YubiKey over receiving codes by SMS, because SMS has known problems.
Words to know
- plugin
- An add-on program that adds new features to a program like Vim.
- undo tree
- A record of all your changes arranged like branches on a tree, so you can return to any earlier version, not only the most recent one.
- leader key
- A special key you press and let go of first, followed by another key, to run a custom command. Many people set it to the space bar.
- persistent undo
- Keeping your undo history saved between editing sessions, so it is still there when you reopen the file.
Example
Think of marks like bookmarks in a book. You put a bookmark on the page you care about, read somewhere else, and then go straight back to that bookmarked page. Vim marks work the same way for lines in your files.
3 checked practice questions for this part are in the app.
Notes written by AI (Claude) from the lecture's official transcript, so check anything important against the lecture. MIT CSAIL · CC BY-NC-SA 4.0 · not affiliated with or endorsed by MIT. These notes are shared under the same license.
LessonBound · Free lecture notes · Privacy · Terms · New York