03 — Programming Fundamentals — Annotated References¶
Every entry has a one-line note saying why you would open it. Free unless marked otherwise.
If you read one thing from this page, read Operating Systems: Three Easy Pieces. If you read two, add Crafting Interpreters. Between them they explain most of why Android works the way it does.
Start here if this chapter was your first exposure to code¶
| Resource | Why |
|---|---|
| Automate the Boring Stuff with Python | Free. The gentlest genuine start, and it produces useful scripts from chapter one rather than toy exercises |
| Python official tutorial | Unusually well written for an official document; read it after Sweigart, not before |
| Exercism | Free, mentored practice in 50+ languages. The mentoring is the part that makes it work |
| The Missing Semester of Your CS Education | MIT. Shell, editors, git, debugging, profiling — everything courses assume you already know |
| Learn X in Y Minutes | A whole language's syntax on one page. Use it to read an unfamiliar language, which is most of this job |
| Godbolt Compiler Explorer | Paste code, watch the assembly appear as you type. The single best intuition-builder for §2.3 |
Systems: memory, the stack, the heap, the machine¶
| Resource | Why |
|---|---|
| Operating Systems: Three Easy Pieces | Free. The best explanation anywhere of processes, virtual memory, the stack and the heap. Directly underpins §3.1 and §3.14 |
| Computer Systems: A Programmer's Perspective | Not free. Bits, two's complement, assembly, linking. The machine-level view this chapter compresses |
| Beej's Guide to C Programming | Free, readable, and honest about pointers instead of apologetic |
| Beej's Guide to Network Programming | Free. Sockets from first principles; background for every networking chapter here |
| What Every Programmer Should Know About Memory | Drepper. Dense and free. Why data layout and cache behaviour matter — the reason arrays beat linked lists in practice |
| What Every Computer Scientist Should Know About Floating-Point Arithmetic | Goldberg. The authoritative answer to the 0.1 + 0.2 question |
| The Linux Programming Interface | Not free. The reference for syscalls, processes and signals when you need certainty |
How languages are actually implemented¶
| Resource | Why |
|---|---|
| Crafting Interpreters | Free online. Builds an interpreter, then a bytecode virtual machine, from scratch. The fastest route to genuinely understanding §3.18 and therefore ART |
| Writing an Interpreter in Go | Not free. The most approachable compiler book available; the Go is incidental |
| Compilers: Principles, Techniques and Tools ("the Dragon Book") | Not free. The classic reference. Consult it; do not read it cover to cover |
| A Tour of the JVM | The bytecode instruction set behind javap -c output |
| Dalvik bytecode reference | The instruction set you will read in Smali — register-based, unlike the JVM's stack machine |
Algorithms and data structures¶
| Resource | Why |
|---|---|
| Open Data Structures | Free, rigorous, covers exactly §3.9 to §3.11 |
| Big-O Cheat Sheet | One page, every common structure and algorithm. Pin it |
| VisuAlgo | Animated hash tables, trees and sorting. Watch a hash table degrade under collisions rather than reading about it |
| Hash collision DoS (28c3) | The talk that made hash-flooding a mainstream concern; background for §3.10.6 |
Official language and platform documentation¶
| Resource | Why |
|---|---|
| The Java Language Specification | Normative on integer overflow, string interning, and every "does it really do that?" question |
| The Java Virtual Machine Specification | The bytecode reference |
| Kotlin documentation | Especially null safety, which is the strongest argument for Kotlin over Java |
| cppreference (C) | The C reference that is actually accurate |
| cppreference (C++) | Same, for the language most of AOSP's native side is written in |
| Python documentation | |
| DEX format | Where §3.10 pays off |
| Android NDK guides | Where Java's memory safety ends |
| ARM Architecture Reference Manual (AArch64) | The authority for every instruction in a .so. Search it; do not read it |
| System V ABI / AAPCS64 | The calling convention: which register holds which argument. Needed constantly when reversing native code |
Secure coding and vulnerability classes¶
| Resource | Why |
|---|---|
| CWE — Common Weakness Enumeration | The standard taxonomy. This chapter creates CWE-190 (integer overflow), CWE-787 (OOB write), CWE-125 (OOB read), CWE-416 (use after free), CWE-476 (null deref) |
| SEI CERT C Coding Standard | Rule by rule, with compliant and non-compliant examples. INT30-C and INT32-C are §3.4 |
| Google Security Blog — memory safety | The data behind "~70% of critical vulnerabilities are memory safety", and the reasoning behind Rust in AOSP |
| AddressSanitizer | Turn this on and it finds the bug in §9.2 in one second |
| UndefinedBehaviorSanitizer | Catches signed integer overflow at the exact line and column |
| libFuzzer tutorial | The highest yield per engineering hour of anything in this list |
| OWASP MASVS | Where these fundamentals map onto mobile requirements |
| Smashing The Stack For Fun And Profit | Aleph One, 1996. Historically the paper that made §3.8.3 matter. Read it for the mental model, not for a working exploit |
Version control¶
| Resource | Why |
|---|---|
| Pro Git | Free. Chapter 10, "Git Internals", is the one that makes the DAG model in §3.19.2 click |
| Learn Git Branching | Interactive DAG visualiser. Twenty minutes here beats a week of memorising commands |
| git-filter-repo | The correct way to purge a secret from history — and a good demonstration of how much easier it is not to commit it |
| gitleaks | Scans history for secrets. Run it on any repository you are given source access to |
Debugging¶
| Resource | Why |
|---|---|
| GDB documentation | Especially watchpoints, which answer "what is corrupting this?" — a question printing cannot |
| LLDB tutorial | The debugger for Android native code |
| Debugging: The 9 Indispensable Rules | Not free, short. The best thing written on debugging as a discipline. "Quit thinking and look" is worth the price alone |
| Android Studio debugger guide | Breakpoints, conditional breakpoints and evaluate-expression on a live app |
| rr (record and replay) | Deterministic replay debugging on Linux; step backwards through an execution |
Practice¶
| Resource | Why |
|---|---|
| Exercism | Language fluency with human feedback |
| Advent of Code | Small, self-contained problems. Good for building the "I can just write a script for that" reflex |
| pwn.college | Free. Turns §3.8 and §3.13 into hands-on exploitation |
| Nightmare (binary exploitation course) | Free, worked examples from trivial to hard |
| Microcorruption | Free. Assembly and memory corruption in a browser, no setup at all. The best on-ramp to reading disassembly |
Related chapters¶
| Chapter | Relationship |
|---|---|
| 01-Computer-Science-Basics | The machine this chapter writes programs for |
| 02-Linux-Basics | Processes, memory and the kernel |
| 04-Java | The next chapter — every concept here, in Java specifics |
| 05-Kotlin | Null safety and what modern Android is written in |
| 18-ARM | The bottom of the abstraction ladder from §2.1 |
| 11-Android-Runtime | Where §3.18's theory becomes a real runtime |
| 12-DEX-Internals | The string pool that §3.10 prepares you for |
| 13-ART | Interpretation, JIT and AOT in practice |
| 14-Dalvik | The Smali you will read, instruction by instruction |
| 16-JNI | Where Java's memory safety ends |
| 19-Memory | Heap dumps, and finding the secrets §3.14.4 warns about |
| 40-Obfuscation | What survives renaming, and why |
| 53-Frida | The instrumentation used in §7 |
| 65-Hooking | Function calls, from first principles, weaponised |