Second edition with machine learning, deep learning, LLMs & AI available now! Buy now

Announcing the Second Edition

The second edition of The Computer Science Book is now out in ebook, paperback and hardback! There are three new chapters on machine learning, deep learning and LLMs & AI. Existing chapters are revised and expanded. Overall, there’s about 75% extra content for the same price.

If you are reading this by email, you probably signed up after reading something on this site, maybe quite a long time ago, and then I mostly vanished. Sorry about that. Now that the second edition is out, I am reviving the list. I’m going to start sending out useful computer science explainers, deep dives and visualisations on a roughly once every 1-2 weeks cadence. Topics will range across the book’s full content, but it will lean towards AI since, as we’ll see, that’s where I’m spending my energy these days.

Get the second edition here

What’s new

The big addition is the three new chapters. When I wrote the first edition back in 2019, machine learning and deep learning were clearly important but I thought slightly outside the scope of a book covering the “core” topics. They were advanced electives, if you like.

What’s more, I didn’t feel knowledgeable enough to give them a good treatment. The motivation behind The Computer Science Book is that readers need an opinionated, curated path through the territory. It’s no good just dumping loads of information and letting them sift for relevance, as many of the textbooks do. I want to build the reader’s intuition with a carefully chosen sequence of topics, illuminating examples and clear exposition. I can’t do that if I don’t already know the material inside out.

Still, the idea of doing an updated version with more topics was always in the back of my mind.

By 2026, of course, AI is everywhere and absolutely critical to understand for anyone even vaguely interested in computing. It’s a non-negotiable now. Happily, I had spent the previous four years studying the mathematics, textbooks and tools to understand how all this worked in depth.

The second edition now covers:

  • Machine learning: how we can apply mathematical tools from statistics to build programs that learn from data instead of hardcoded rules. Machine learning is the foundational pattern of modern AI but it’s very different from the “classical” computer science covered in the first ten chapters.
  • Deep learning: takes these ideas and applies them to neural networks with many layers. This is a lot of faff but unlocks programs that can discover ways of representing messy data like language, audio and video.
  • Large language models and AI: goes from the basics of how LLMs like ChatGPT actually work right up to the cutting edge of AI research. I cover things like interpretability because I think they’re only going to become more important in future.

As always, I focus on what you need to know to succeed, not pages of derivations and proofs. The chapters are aimed at working devs and curious amateurs, not people who want to become ML researchers. You need a good mental model of how these systems work so you can understand their capabilities and detect when lurid claims start to drift away from reality.

Apart from the new chapters, the existing ones have all had a revision and new content added. In the first edition, my target had been roughly 10,000 words per chapter. That’s surprisingly little space! In some places, I felt that keeping under the word count had led to slightly superficial treatments or skipping important topics (e.g. file systems, network security). So I went through and added new content in all those places.

Overall, the second edition is 75% longer. The physical copies are about 430 pages long. They’re solid textbooks, if I may say so myself.

Admiring the new cover on the proof copies

What has not changed

The book is still for people who learned programming without getting the tidy university tour of the subject.

It is not trying to be a full CS degree in book form. That would be enormous and mostly unreadable. It is a practical map of the territory: enough computer architecture, operating systems, algorithms, networking, databases, concurrency, theory, programming languages, compilers, distributed systems, machine learning, deep learning, and AI to make the modern software stack feel understandable the whole way down.

The point is still to help with the problem I had when I started programming professionally: I did not know what I did not know. You don’t want to build your career on shaky foundations.

It’s a horrible feeling to only learn about some crucial concept after causing a production outage (ask me how I know).

I imagine The Computer Science Book more like a hop-on-hop-off tour bus. When you arrive in a new city, you’re completely bewildered, don’t know where anything is and don’t even know what all the signs mean. A hop-on-hop-off bus will take you on structured tour of the main sights, point out where everything is and give you the essential context of how it all fits together. It gives you the information you need to follow your own path from there. That’s why every chapter ends with a further reading section to signpost your next steps.

The second edition follows the same principle, except the bus tour is a little longer and the tour guide gives you more detailed information as you go around.

What surprised me is that often readers did have computer science degrees, but they felt some topics hadn’t been explained very well and The Computer Science Book helped them fill in the gaps in their mental models. Getting feedback like that was very gratifying.

How to get it

The ebook is available now for $29 and includes PDF and EPUB formats. The paperback and hardback editions are also available on Amazon (all marketplaces).

Get the second edition

There is a 28-day money-back guarantee, because I am confident you will find it valuable.

What comes next

This newsletter is going to be where I post interesting and useful things, probably on topics like:

  • Running local LLMs and how understanding computer architecture helps us reason about their performance
  • Interactive visualisations to develop intuition
  • Software engineering in a world of agentic AI
  • AI interpretability and steering

The overriding aim will be taking the lessons from the book and applying them to the latest technical developments. I’ll demonstrate how good computer science fundamentals are a superpower for understanding complex topics, even in the age of AI.

I am also drafting a short roadmap for learning computer science, aimed at a few categories of learner, which I will share separately once ready. That should be useful whether or not you buy the book.

To everyone who bought the first edition, sent feedback, or asked when the next version was coming: thank you. Writing a book is a slog, no way about it, and those messages made it feel worthwhile.

I hope the second edition helps a few more people find their way on to firmer ground.