Reading code is part of just about everything we do in software development. But "code reading" isn't a single technique. There are plenty of ways to approach it, and picking the wrong one for the task can leave you stuck.
In this post, We'll break code reading into two broad categories that call for different approaches and techniques. We'll call them "micro code reading" and "macro code reading".
Let's look at how they work, where they differ, and when to use each one.
What Is Micro Code Reading? #
Micro code reading is what most developers picture when they think of reading code. You go through the code line by line, following references across files as needed.
The goal is to get to the answer quickly. Ideally, you follow a direct path through just the code you need, without getting sidetracked. Anything off that path is noise. And the more information you pick up along the way, the easier it is to lose track of what you're looking for.
Micro code reading focuses on understanding what the code does and how objects relate to one another.
That makes the ability to read and understand the language's syntax the most fundamental skill. Search skills matter, too. You need to find the right code and narrow down what deserves your attention.
Most of the code reading we do in our day-to-day development work falls into this category.
What Is Macro Code Reading? #
Macro code reading covers a broader scope of code than micro code reading.
Instead of digging into implementation details, the goal is to understand the bigger picture: the structure, the context, and the design behind the code. You're trying to understand higher-level designs and specifications, such as technical or functional specifications, rather than exactly how each piece is implemented.
This approach assumes you'll be dealing with a lot of information and piecing together clues as you go. Reading the official documentation and README files beforehand can give you a serious head start.
You're also working with more code than you can realistically read in full. So you need to quickly decide what's worth reading and what you can skip. Just as important, you need to organize the information you collect along the way.
Macro code reading tends to fall to more experienced developers. For many programmers, it's not something they do nearly as often as micro code reading.
When Should You Use Micro or Macro Code Reading? #
Based on how these two approaches work, we can roughly map common development tasks to the type of code reading they tend to call for.
| Situation | Micro | Macro |
|---|---|---|
| Fixing bugs | ✓ | |
| Adding new features | ✓ | |
| Testing | ✓ | |
| Choosing libraries or frameworks | ✓ | |
| Code reviews | ✓ | |
| Debugging | ✓ | |
| Helping out on another project | ✓ | |
| Assessing a situation during an incident | ✓ | |
| Learning from official language or framework documentation | ✓ | |
| Coding along with technical books, online courses, or tutorials | ✓ | |
| Finding and collecting useful code examples | ✓ | |
| Refactoring | ✓ |
These aren't hard rules. In real-world development, any of these situations might call for both approaches. Still, the general pattern should make sense.
Experienced developers probably switch between micro and macro code reading without even thinking about it.
But if you're a beginner or intermediate developer who struggles with code reading, you might be using the opposite approach from the one shown in the table—and feeling that something isn't quite right.
What's the Difference Between Micro and Macro Code Reading? #
The key difference between micro and macro code reading lies in their purpose.
You're looking for different kinds of information and trying to solve different kinds of problems. The level of detail and abstraction you need determines how you approach the code.
Micro code reading focuses on understanding the implementation itself. You want to know exactly what the code does. Understanding why a particular implementation is necessary or what led to it isn't the main goal.
Macro code reading, on the other hand, focuses on understanding the code's structure, context, and high-level flow. You're trying to figure out the design, the decisions behind it, and the reasoning that shaped those decisions. Unlike micro code reading, understanding every implementation detail isn't the priority.
Why do experienced developers switch between these approaches so naturally?
I guess they have a clear sense of what they're trying to find out. That sense of purpose guides how they read the code.
Wrapping Up #
We've looked at two approaches to code reading—micro and macro—that call for different methods and techniques.
The difference comes down to what you want to learn from the code and why you're reading it in the first place.
Choosing the right approach for the situation helps you avoid information overload and get to the answers you need without unnecessary detours.
Even if you find code reading difficult, having a clear goal can make it much less frustrating. Know what you're looking for or what problem you're trying to solve, then pick an approach that fits.
The next time you sit down to read some code, ask yourself: Am I reading at the micro level or the macro level? And does that match what I'm trying to accomplish?
That simple distinction could change how you approach the task.