Readable code is better than efficient code

There, I've said it. Time to pull out the pitchforks and burn me at the cross. I know some developers in the industry will disagree with this statement. Efficient code is the holy grail of programming and I know a few developers who would sacrifice readability and their first born in the name of efficient code. I think this viewpoint is leading us as an industry down a bad path.

I totally agree if you can do both, readable and efficient code is the best. Some "rockstar" developers might not have any problems writing elegant and optimized code without breaking a sweat. But for every one of those, there's many who will have to struggle with maintaining a balance between the two. Us mere mortals will eventually run situation where they will need to choose between readability and performance.

I'd argue choose readability in most cases. Unless whatever you are coding needs performance (as in the business will suffer substantial revenue drops if the software takes extra seconds to run), you should optimize for readability. I'd say most developers are coding business software for their respective companies. An extra second or two will not make a different in the software performance.

Developers like to think that their software is the center of the universe, but its not. The software is a part of the key to success but is not the primary key. Both people and software are the key. What's important is the software is up, works as expected, and new features are added in a timely manner.

Software enables others in the company to perform their job with efficiency. These people need the software up and running and new features and changes to help drive revenue. Readability and maintainability helps enable this.

Developers come and go, but their software is here to stay. Keeping clean and readable code allows new developers to be onboarded faster and enables them to productive early. This also applies to junior developers who might need to take longer to read and understand the code. It even helps developers who originally wrote the code as it may not have been touched in awhile. If the code is super efficient but hard to read, it doesn't help the company add the needed features and changes to drive the business forward.

readability  coding