All Tutorials
All programming and AI tutorials, organized by series.
Go Practice
Build a Command-Line Tool in Go
A line-counting CLI from scratch: flag parsing, reading files or stdin, bufio scanning with a raised buffer, exit codes, subcommands, and version injection with ldflags.
Build an HTTP Service in Go
A JSON API with only net/http: method-based routing, request decoding and validation, a single error shape, request ID and logging middleware, timeouts, graceful shutdown, httptest.
Go Intermediate
Modules, Packages and Internal Boundaries in Go
How modules, packages and directories fit together: go.mod and go.sum, internal packages, exported identifiers, go get and go mod tidy, MVS, replace, vendor and cycles.
Testing and Benchmarking in Go
Table-driven tests with the testing package: subtests, t.Helper and t.Cleanup, temp dirs, httptest, benchmarks with b.Loop, allocs/op, coverage and fuzzing.
Context and Cancellation in Go
What context is for: Background versus TODO, WithCancel/WithTimeout/WithDeadline, ctx as the first parameter, select on Done, leaks, why it must not live in a struct.
Goroutines and Channels in Go
The concurrency primitives, used correctly: go with WaitGroup, buffered versus unbuffered channels, close and range rules, select and timeouts, worker pools, mutex versus channels.
A Practical Introduction to Go Generics
Type parameters and constraints: any and comparable, custom constraints with ~, Map and Filter helpers, generic types, type inference, and when not to use generics.
Profiling Go with pprof
Capture CPU and heap profiles from benchmarks or a live server, read top, list and flame graphs, compare allocations, and keep /debug/pprof off the public internet.
Go Basics
Go Setup and Your First Program
Install Go 1.24, understand what GOPATH and module mode really mean, and get comfortable with go mod init, go run, go build, go fmt and go vet.
Go Variables, Types and Zero Values
var versus :=, the zero-value design that removes uninitialised variables, constants and iota, and the boundaries between string, byte and rune.
Go Control Flow: if, for and switch
Why Go has exactly one loop, how the if initialiser keeps variables scoped, what switch does differently, and how range behaves over slices, maps and strings.
Go Functions and Error Handling
Multiple and named results, the error interface, wrapping with %w and inspecting with errors.Is and errors.As, plus where defer, panic and recover belong.
Slices versus Arrays in Go
Arrays carry their length in the type and copy on assignment; slices are small descriptors over shared memory. Length, capacity and append aliasing explained.
Go Maps and Structs
Declaring and populating maps, the comma-ok idiom, why nil maps panic on write, plus struct literals, exported fields, JSON tags and embedding.
Go Pointers, Methods and Value Semantics
Address-of and dereference, new versus composite literals, value and pointer receivers, method sets and interface satisfaction, plus when a pointer is worth it.
Go Interfaces and Composition
Implicit interface satisfaction, why small interfaces travel further, type assertions and type switches, the nil-interface trap, and composition over inheritance.
JavaScript Basics
JavaScript Variables: var, let and const
How var, let and const differ in scope, hoisting and rebinding, what the temporal dead zone protects you from, and why typeof null returns "object".
JavaScript Operators and Type Coercion
Why == surprises you, which eight values are falsy, how + and - coerce differently, and when to reach for ??, ?. and Number.isNaN().
JavaScript Conditionals and Loops
Pick between if, switch, for, for...of and while with intent, and avoid the iteration bugs: fall-through cases, for...in on arrays, and break inside forEach.
JavaScript Functions, Scope and Closures
Compare declarations, expressions and arrow functions, use default and rest parameters, and understand scope chains, closures, and the classic var-in-a-loop trap.
Essential JavaScript Array Methods
Split the array API into methods that mutate and methods that return a new array, then use map, filter, reduce, find and some correctly, including sort's string default.
JavaScript Objects and Destructuring
Object literals, property access and iteration, destructuring with renames and defaults, and why spreading gives you a shallow copy that still shares nested objects.
JavaScript Strings and Template Literals
Template literal interpolation, string immutability, UTF-16 length surprises, slice versus substring, and why replace() only changes the first match.
JavaScript Error Handling
What an Error carries, when to throw, how try/catch/finally runs, custom error classes with instanceof, the cause option, and why async errors escape try/catch.
JavaScript Intermediate
JavaScript Modules: ESM and CommonJS
Named and default exports, live bindings, dynamic import, the CommonJS snapshot trap, interop rules in Node, the exports map, and how to break a cycle.
JavaScript Async and Promises
Why 1 4 3 2 is the correct order, promise states and chaining, async/await error handling, serial versus parallel work, the four combinators, and concurrency limits.
JavaScript fetch and HTTP in Practice
fetch does not reject on 404, a body can be read once, timeouts need AbortSignal, retries need backoff, and browsers add CORS on top of all of it.
JavaScript DOM and Events
Selecting and creating nodes, batching updates, capture and bubble, event delegation, listener cleanup with AbortSignal, form handling, and the XSS risk in innerHTML.
JavaScript Tooling: npm, Vite and Linting
package.json fields that matter, lockfiles and npm ci, script conventions, Vite dev versus build, why VITE_ variables are public, and ESLint versus Prettier.
Testing JavaScript with Vitest
Set up Vitest, pick the right assertion, test async code with fake timers, replace dependencies with vi.fn and vi.mock, and enforce coverage in CI.
JavaScript Practice
JavaScript Practice: a Node.js CLI Tool
Build linkscan: parse arguments with parseArgs, walk Markdown files, probe external links with bounded concurrency, print machine-readable output, and return real exit codes.
JavaScript Practice: a Frontend App Without a Framework
A reading list in plain JavaScript: one state object plus a render function, event delegation, localStorage with validation and migration, form errors, and keyboard access.
PHP Practice
Build a Todo App with PDO
A complete PHP project: SQLite schema, add/toggle/delete over POST, CSRF tokens, Post/Redirect/Get with flash messages, escaped views, and a pre-deploy checklist.
A JSON REST API with PDO
A minimal REST API without a framework: method dispatch, one JSON error shape, input validation, pagination and sort whitelists, status codes, and curl checks.
PHP Intermediate
Composer and Namespaces in PHP
Dependency management and PSR-4 autoloading: composer.json structure, namespace mapping, version constraints, the lock file, scripts and autoloader optimisation.
PDO and Prepared Statements
Safe database access with PDO: DSN and connection options, exception mode, named and positional parameters, transactions, and where placeholders stop working.
Objects and the Type System in PHP
Constructor promotion, readonly properties, backed enums, interfaces versus abstract classes, traits, union and nullable types, and why strict_types comes first.
Templates, Layouts and Escaping in PHP
Split querying from output with one small render function: layouts, partials, htmlspecialchars-based escaping, alternative syntax, and what views must never do.
Debugging and Logging in PHP
Two error configurations, custom handlers for errors and exceptions, JSON logs with request IDs, Xdebug breakpoints, and a triage order for the white screen.
Unit Testing PHP with PHPUnit
Install PHPUnit 11 with Composer, choose assertions that actually fail, use data providers and test doubles, test PDO code on SQLite, and run coverage in CI.
PHP Basics
PHP Variables and Data Types
Variable syntax and scope, the scalar types, strings and arrays, why loose comparison bites, what declare(strict_types=1) actually changes, and the falsy values that surprise newcomers.
PHP Strings and Arrays
Indexed and associative arrays, how foreach really iterates, array_map/filter/reduce, the difference between + and array_merge, and the string functions you need — including mb_* for UTF-8.
PHP Conditionals and Loops
if versus match versus switch, when to use for, foreach and while, break/continue with nesting levels, and the alternative colon syntax that keeps HTML templates readable.
PHP Functions, Types and Scope
Declare parameter and return types, use defaults and named arguments, understand pass-by-value versus reference and object handles, plus closures, arrow functions and static locals.
Handling Forms and Requests in PHP
Work with $_GET and $_POST safely: choose the right method, validate with filter_var, escape output with htmlspecialchars, and follow Post/Redirect/Get to stop duplicate submissions.
Reading and Writing Files in PHP
file_get_contents and file_put_contents for small files, fgets streaming for large ones, file locking for concurrent writes, directory iteration with SPL, and why paths must start from __DIR__.
Errors and Exceptions in PHP
How PHP separates errors from exceptions, the Throwable hierarchy, try/catch/finally, which exception class to throw, JSON_THROW_ON_ERROR, a global handler, and production error settings.
PHP Sessions and Cookies
Start and use sessions, destroy them properly, regenerate the ID on login to prevent fixation, set cookies with secure, httponly and samesite, and never trust cookie contents.
Python Intermediate
Python Comprehensions and Iteration Tools
List, dict and set comprehensions, generator expressions, and the standard library helpers — enumerate, zip, sorted, itertools — that replace most manual loops.
Python Modules, Packages and Virtual Environments
How imports resolve, absolute versus relative imports, the __main__ guard, and isolating dependencies per project with venv, pip and pyproject.toml.
Python Classes and Object-Oriented Basics
Define classes, tell instance and class attributes apart, use @property, @classmethod and inheritance with super(), and implement __repr__ and __eq__ correctly.
Python dataclasses and Type Hints
Annotate your code so editors and mypy catch mistakes before runtime, then let @dataclass generate __init__, __repr__ and __eq__ — with default_factory, frozen and slots.
Python Iterators and Generators
Separate iterables from iterators, trace exactly how yield suspends a function, stream a large file through a generator pipeline, and know when yield from, send and close are worth the complexity.
Python Standard Library Essentials: datetime, collections and json
The standard library modules worth knowing by heart: datetime arithmetic and time zones, Counter, defaultdict and deque, json round-trips, plus os.getenv, subprocess and secrets.
Regular Expressions in Python
How search, match, findall and sub actually differ, the metacharacters you need, greedy versus lazy quantifiers, named groups, compile flags, and the failure modes that make regexes fragile.
Python Practice
Testing Python with pytest
Write your first pytest test, then use plain asserts, pytest.raises, parametrize, fixtures and tmp_path — plus how to organise tests and the anti-patterns that make a suite untrustworthy.
Command-Line Tools and Project Layout in Python
Build a CLI with argparse: positional and optional arguments, types, choices, custom validators and subcommands, then package it with src layout, pyproject.toml and correct exit codes.
Cleaning CSV Data and Writing a JSON Report
A complete, runnable script: read a messy CSV with csv.DictReader, validate and convert each row, count skipped rows by reason, aggregate with collections, and write a JSON report.
Python Basics
Python Variables and Data Types
How Python variable binding actually works, the built-in types you use daily, and why mutable vs immutable changes how bugs show up.
Python Conditionals and Loops
How truthiness works in Python, when to use for versus while, the rarely used loop else clause, and the iteration mistakes that produce wrong results.
Python Strings, Slicing and Formatting
Create and inspect strings, use the methods you actually reach for, format output with f-strings, and keep str and bytes straight at the encoding boundary.
Python Lists and Dictionaries in Practice
The list and dict operations you reach for daily: slicing, iteration, shallow versus deep copies, get versus indexing, and grouping with setdefault.
Python Tuples, Sets and Immutability
When a tuple beats a list, how packing and unpacking work, what immutability actually prevents, and why sets give O(1) membership tests.
Python Functions and Argument Passing
Define functions, mix positional and keyword arguments, avoid the mutable default trap, collect extra arguments with *args and **kwargs, and understand scope rules.
Reading and Writing Files in Python
Open files safely with with, stream large files line by line, build paths with pathlib, and handle JSON, CSV, and encodings without the usual surprises.
Python Exceptions and Custom Errors
How try/except/else/finally actually runs, which exceptions to catch, keeping context with raise from, designing custom error hierarchies, and the anti-patterns that hide bugs.