Don't Outsmart Yourself


 

The great Richard Feynman had a saying.  "The first principle is that you must not fool yourself and you are the easiest person to fool."   

I believe there is a similar principle that can be applied to software engineering.  "Don't outsmart yourself."   

As a software engineer, it can be easy to:

  • Over-engineer a solution to a simple problem.
  • Strive for elegance over ease of understanding for others.
  • Use an obscure, or less popular approach to solve a problem.
  • Abstract away complexity pre-maturely.
  • Write a custom library when something that could have worked off the shelf would have sufficed but maybe wasn't a perfect fit.
It feels good to do these things.  It works parts of your brain that might be aching to do something interesting.   It can impress your peers.  

In time though, you will outsmart yourself

The smarter you are, the more prone you will be to outsmarting yourself.   The trick is to balance ego with prowess.  Yes, you could do it your super smart way, but it is just as effective half a dozen other ways.

Your elegant solution might not be as flexible as you thought, and new requirements may be harder to implement.

Your custom library might not keep up to date with industry trends, and soon those off the self solutions are miles ahead of where you are, and you don't have the time to add those new features.

That abstraction you created was hiding important features from the caller, and now others have made shortcuts and you have a leaky abstraction that serves no purpose.

That fancy new database you used has a custom query language, and a basic recursive query may have sufficed.  Now the new team that is maintaining your project must learn a new query language.

There is a time and place for elegant code, over-engineered solutions, and beautiful abstractions.  Your next work project is 95% likely to NOT be the time and place for them.   

Strive for understandable, well documented solutions.

Strive for maintainability when another team inherits your code.

Don't write code for your ego, write it for the next person.  You write it once, but it may get read hundreds of times by others.  Optimize for reads.  Don't outsmart yourself!

- Andy Glassman

Comments

Popular posts from this blog

Phoenix LiveView: Async Assign Pattern

Write Admin Tools From Day One

Extremely Fake Cheapskates! Season One Recap