From one function to a whole system: clean code, SOLID, design patterns in Python, the building blocks of system design, then designing a multi-service ticketing system whose code AI writes: what people decide, what AI needs to read, with experiments and real measurements.
Code is now read, changed and extended by people and AI agents alike. Tidying a 26-line pricing function step by step: a test over 20,000 random orders first, then names, no magic numbers, no nested ifs, smaller functions, measured complexity, and how agents find, read and imitate code.
The five SOLID principles aren't laws; they're ways to keep one change from bringing down the whole system. Each comes with a runnable example: a square that breaks a rectangle, dict.get skipping __getitem__, and tests with fakes almost 2,000 times faster than a database.
The Gang of Four's 23 patterns were written for C++ and Smalltalk. In Python, Strategy is a function, Singleton is a module, Iterator is a generator. A tour of the patterns still used every day, found in real code, with how many nanoseconds each kind of indirection costs.
System design starts with numbers, not diagrams. A table of measured latencies, quick estimates, Little's law, why a server at 90% load is 5 times slower than at 50%, caching under a Zipf distribution, an index 4,700 times faster, replication, sharding, and handling failure.
A concert ticketing system: seat selection, holds, payment, tickets, notifications, gate check-in, an on-sale waiting room. What people decide, how to split services, measuring double-sold seats and repeated payment webhooks, and writing docs AI can extend features from.