Writing/Book

The Unbearable Lightness of Coding — cover

The Unbearable Lightness of Coding

Dan Gittik · free to read online

Python was one of the first languages I learned – and then kept learning for years. Its elegance and versatility kept surprising me; from design patterns to language internals, it seemed the perfect medium for exploring software engineering at large.

This book grew out of ten years of teaching in industry and academia: a comprehensive, practical and occasionally philosophical overview of this wonderful language. Somewhat tragically, I finished it just as LLMs arrived, and with agents doing most of our coding, it lost some of its luster.

Still, I think there's value in learning to code – it certainly benefits me in my work with AI. It's less about syntax or libraries than a way of reasoning about problems, which still seems to me like the king's road to building good software.

As we reimagine our profession, I hope this guide helps those curious about how their ancestors used to type programs, slowly and manually – and the thinking that informed, and still informs, the paradigm shift we're living through.

Start reading

Contents

  1. 01 Preface23 min
  2. 02 Assignment: Names, Values and Scopes32 min
  3. 03 Conditions: If, Else and Boolean Fluency26 min
  4. 04 Loops: While, For, and the Myth of Anti-Patterns32 min
  5. 05 Functions 1: Signatures as Interfaces34 min
  6. 06 Functions 2: Functional Programming34 min
  7. 07 Functions 3: Code as an Object37 min
  8. 08 Decorators: Mastering Function Objects37 min
  9. 09 Generators: from Iterators to Coroutines14 min
  10. 10 Objects 1: IDs, Types and Values34 min
  11. 11 Objects 2: Inheritance43 min
  12. 12 Objects 3: Mastering Magic Methods42 min
  13. 13 Objects 4: Attributes, Methods and Descriptors49 min
  14. 14 Objects 5: Lifecycle and Context Management36 min
  15. 15 Metaclasses (and Are They Even Useful?)42 min
  16. 16 Modules: from Dynamic Evaluation to Packages40 min
  17. 17 Error Handling: Exceptions, Tracebacks and Frames45 min
  18. 18 Native Types: Numbers, Strings and Containers46 min
  19. 19 The Standard Library: Datetimes, Paths and Regular Expressions41 min
  20. 20 The Walrus Operator: the Syntax and the Drama19 min
  21. 21 The Match-Case Statement: So Much More than Switch14 min
  22. 22 Type Hinting: The Dubiously Good, the Hypothetically Bad, and the Undeniably Ugly64 min
  23. 23 Workflow: How to Write a Python Project21 min
  24. 24 Performance: is Python Really that Slow?59 min
  25. 25 Networking: How the Internet Works43 min
  26. 26 Socket Programming: Clients, Servers and More41 min
  27. 27 Concurrent Programming: Threads, Locks and the GIL59 min
  28. 28 Async Programming: Select, Callbacks, and Coroutines77 min
  29. 29 Web Development: How the Web Works45 min
  30. 30 Web Programming: How to Write a Webserver50 min
  31. 31 CLIs: an Underrated Interface, and Why You Should Use Click46 min
  32. 32 GUIs: an Overrated Interface, and Why You Should Use Javascript36 min
  33. 33 Design Patterns: the Gang of Four, and Whether We Still Need Them55 min
  34. 34 Complexity: Where It Comes From, and Who Pays for It52 min
  35. 35 Epilogue: The Unbearable Lightness of Coding15 min