Do the least amount possible
I've been thinking a lot about principles in front end development lately. Techniques come and go as technology evolves.
The how of things quickly changes. The why is much more timeless.
A principle that is emerging for me is simple: do the least amount possible.
This has several meanings, and I think is a reflection of reaching a certain point of maturity as a developer.
Doing the least amount possible doesn't mean being lazy; actually, it's quite the opposite. At its core, it means that you need to take the time to fully understand a problem, and the context that the problem exists within, before offering a solution. That solution should be the least-engineered way to solve the problem.
The more complex and overly-engineered a solution might be, the more:
- It's prone to breaking
- It's hard for others to understand and maintain, especially long after it was originally implemented
- The time invested might be wasted if business needs change (which they will)
As I've gotten more mature as a developer, I've started having a sort of "spider sense" when a solution is getting more complex than it needs to be. I don't have specific advice on how to evaluate this other than: trust your gut. If something feels more complex than it needs to be, it probably is.