Reading documentation and learning on your own
No programmer memorises everything. Senior engineers look things up all day. The real skill is knowing how to find answers quickly and reliably. This lesson teaches you to learn without a teacher.
Where good answers live
| Source | Best for | Examples |
|---|---|---|
| Official documentation | Accurate, complete, up-to-date reference | MDN (web), docs.python.org, react.dev, docs.docker.com |
| Error message search | Fixing a specific error | Search engines, Stack Overflow, GitHub issues |
| Source code | How a library really works | GitHub repositories |
| AI assistants | Explanations, first drafts, brainstorming | Always verify what they say against the docs or by running the code |
| Tutorials and courses | Learning a new topic step by step | Like this site! |
Prefer primary sources. A blog post from 2017 may describe an API that has since changed. The official docs are the source of truth, so check the version number.
Anatomy of a documentation page
Most reference docs follow the same structure. Here's how to read MDN's page for JavaScript's Array.prototype.slice():
- Signature (syntax):
slice(start, end). Square brackets in docs often mean optional:slice([start[, end]]). - Parameters: what each input means, its type, and its default.
- Return value: what you get back. Here, a new array.
- Description: behaviour details and edge cases (negative indices count from the end!).
- Examples: usually the fastest way to understand.
- Browser or version compatibility.
Now verify your understanding by experimenting. Docs + quick experiments is the fastest way to learn:
Built-in help
Many languages let you read the docs from inside the program:
In a terminal: man ls, git help commit, python -m pydoc json, or some-command --help.
How to search effectively
- Include the language or tool and the version:
python 3.12 read csv file, not justread file. - Paste the exact error message, minus your own file paths and variable names.
- Describe the goal, not your broken attempt: "javascript remove duplicates from array".
- Look for results from the official docs, Stack Overflow answers with high votes and recent dates, and GitHub issues for library bugs.
Asking good questions
When you're stuck after trying, ask in a way that gets fast, good answers:
- What you're trying to do, the goal.
- What you tried, with a minimal code example that reproduces the problem.
- What you expected vs what actually happened, including the full error message.
- Environment: language version, OS, library versions.
Creating a minimal reproducible example often reveals the answer before you even ask.
Learning a new language or tool, fast
- Do the official "Getting started" or tutorial.
- Learn the core: variables, types, conditions, loops, functions, collections, errors.
- Build something small immediately, like a to-do list, a calculator or a file renamer.
- Read other people's code on GitHub.
- Learn the ecosystem: package manager, testing, formatting.
Avoid tutorial hell. Watching tutorial after tutorial feels productive but isn't. Real learning happens when you build something without step-by-step instructions and get stuck. Getting unstuck is the skill.
Practice
Using only Python's built-in help() and experiments (no searching!), figure out:
- What does
str.centerdo, and what's its second parameter? - How do you sort a list of words by their length? (Hint:
help(sorted)and look atkey.)
1.What's the most reliable source for how a function works?
2.What does a "minimal reproducible example" mean?