Early on, I thought good code meant clever code. If I could write something in one line that took someone else five, I felt like I'd won. I was optimizing for the wrong thing entirely.
Here's what I've learned since.
Junior me wrote code for the computer. The me now, writes code for the person who'll read it six months from now, usually myself at 2am when something breaks.
The difference shows up everywhere.
Take a simple feature. A junior developer builds it, it works, they move on. Done in an afternoon. But look closer. The logic is tangled inside the component. Business rules are sprinkled across three files with no clear home. There's no test because "it's too simple to break." A month later, someone needs to change one condition, and suddenly four unrelated things stop working.
A senior developer spends the first hour not writing code at all. They're thinking about boundaries. Where does this logic actually belong? How will this be tested? What happens when requirements change, because they will? The initial implementation might take longer, but the next change takes minutes instead of days.
Juniors optimize for completion. Get the ticket done, move to the next. The metric is speed to merge.
Seniors optimize for comprehension. Can someone new to this codebase understand this in ten minutes? Is the intent clear or just the implementation? Will this break silently or loudly when something goes wrong?
A senior engineer writes a function and immediately thinks, "How would I test this?" If the answer is "awkwardly," the function probably needs restructuring. Not because testing is the goal, but because hard-to-test code is usually tightly coupled, and tightly coupled code is brittle.
The real shift isn't technical. It's temporal.
Juniors think about now. Does it work today?
Seniors think about later; Will it survive the next hire, the next feature, the next year of dependencies and shifting requirements?
Speed to completion to meet that deadline looks efficient until you're the one untangling a year of shortcuts.
That begot the title of this blog "The fastest code I've ever written was code I didn't have to rewrite".
Top comments (0)