About
Posted 5 days ago · 23,582 reads
Legacy code is called legacy for a reason. It works. It's been tested in production. It's often the most reliable code in your system, even if it doesn't follow modern conventions.
The most important insight I've had in the last few years is that constraints are a feature, not a bug. When you have unlimited resources, you can solve any problem in a hundred different ways. When you have constraints—limited memory, limited time, limited developers—you're forced to think more clearly.
Optimize for comprehension first.
Most of the code we write is not rocket science. It's ordinary business logic, wrapped in layers of frameworks and abstractions. Sometimes the simplest implementation is the best.
APIs are contracts. Once you publish one, changing it becomes expensive for everyone who depends on it. The cost of breaking changes compounds over time, which is why the boring, conservative choice is usually the right one.