Python
The default choice for a quick script, data wrangling, or gluing two APIs together — a huge standard library, minimal ceremony to get started.
Lesson 1 of 2
Writing a one-off migration script under time pressure starts with knowing which language actually fits the job, not defaulting to whichever one you know best.
Four languages cover most of the scripting and tooling work a web developer actually does.
The default choice for a quick script, data wrangling, or gluing two APIs together — a huge standard library, minimal ceremony to get started.
Runs everywhere a browser does, plus the server via Node — the one language you can't avoid as a web developer regardless of what else you know.
JavaScript plus a type system — catches a whole category of bugs (wrong shape, undefined access) at compile time instead of in production.
The glue between everything else — chaining commands, automating a repetitive terminal task, or writing the script that runs in CI.
A few heuristics cover most decisions.
Reach for Bash when the task is mostly chaining existing CLI tools together. Reach for Python when you need real data structures, explicit error handling, or the script will be read and modified by someone else later. Reach for Node/TypeScript when the script needs to share code or types with an existing JS/TS codebase.
Compare the two implementations below, then work through both exercises.
# Bash: quick, one-off, fine for this scope
du -ah . | sort -rh | head -n 5
# Python: same task, but now it's testable, reusable, and handles edge cases
from pathlib import Path
sizes = sorted(
((p, p.stat().st_size) for p in Path('.').rglob('*') if p.is_file()),
key=lambda x: x[1],
reverse=True,
)
for path, size in sizes[:5]:
print(f"{size:>12} {path}")Answer in your head first, then click a question to reveal the answer.
Work through the sample comparison and check each item off. Progress is saved in your browser.
These primers are a starting point. Read the primary sources to build real fluency.
What building this project taught me.
Full-Stack Production Bar (the next lesson) was the named gap in the job-hunting scan. This lesson comes first because picking up an unfamiliar language under pressure assumes general scripting fluency already exists.
Neither Bash nor Python is "better" in general — the point of the exercise is recognizing which trade-offs matter for a given script's expected lifespan and audience.