Writing Code Is Easy. Reading It Isn't

https://news.ycombinator.com/rss Hits: 6
Summary

Writing code is easy. Once you have a solution in mind, and have mastered the syntax of your favorite programming language, writing code is easy. Having an LLM write entire functions for you? Even easier. But the hard part isn’t the writing. It’s the reading. It’s the time it takes to load the mental model of the system into your head. That’s where all the cost really is. A mental model is the thing you build when you read code. It’s your internal map of how the system works, where the tricky parts are, what depends on what. Without it, you’re just staring at lines of text. When I worked as a contractor, most of my jobs started the same way. I’d get a task to fix a bug or add a new feature in an application I’d never seen before. My mental model was clean and empty at first. To start filling it, I’d check the homepage to see what it looked like. I’d look at the page source: is this React? jQuery? A third-party plugin? I’d scan the codebase to see if the carousel they are requesting on the front page was used elsewhere. I’d check their build process, their testing setup, the tools they leaned on. Every little detail I discovered got appended to the model in my head. It was like moving into a new city. You start at the foot of your apartment, wander a few streets, notice which roads lead to the freeway, where the grocery store is, and slowly you start to orient yourself. That’s what reading code feels like: you’re building a mental map so you don’t get lost every time you move around. Say you need to understand a simple function like getUserPreferences(userId). To build your mental model, you need to trace: Where is this function defined? What does it return? Is it a Promise? What's the shape of the data? Does it hit a database directly or go through an API? Are there caching layers involved? What happens if the user doesn't exist? Who else calls this function and in what contexts? Are there side effects? Understanding that one function means jumping between database ...

First seen: 2025-09-08 18:47

Last seen: 2025-09-08 23:49