Hacker News new | ask | show | jobs
by kungtotte 2081 days ago
I think a lot of the time people think they have performance issues when they in fact don't, likewise with stability and flexibility.

In most cases, writing the readable and straightforward version first and only moving to the less readable but more X version (for any given value of X) after it's evident that you need to is the optimal solution.

It's the programming equivalent to buying cheap tools first and only buying the expensive version once the cheap one breaks: If it breaks you used it enough to warrant the expensive and more durable one, and if it didn't break you didn't have to spend more money than necessary.

1 comments

I do see your point but let me say a bit about performance, performance matters a whole lot if your software is being used seriously all day long for getting things done in the real world.

If your software is going to be someone's day job it can't afford to be slow because users would take note and complain loud and clear because it's wasting their time. Just imagine git taking 15mins for showing diffs, would you accept that for an improvement in code readability and straightforwardness.

So for different industries there are different X's that matter a whole lot more than mere readability and developer convenience.

I absolutely agree that performance matters a whole lot, it's one of the most important considerations in software.

It's also true that many developers are not very good at spotting where and how to improve performance, and what trade-offs are appropriate, and that's what I meant.

Write the straightforward version first that's easy to read so that when you need to improve performance, it's easy to use a profiler to go in and rewrite the non-performant parts in a less readable but faster way.