Hacker News new | ask | show | jobs
by mark-r 2470 days ago
I've found that the readability of fast code vs. slow code is often negligible - certainly it is in the specific example under discussion. I prefer to make a habit of using faster idioms in that case, so that when speed does matter I'm already covered. I don't consider that premature optimization.
1 comments

Except it isn't, because most of your developers will be using an environment that includes syntax highlighting and probably some linting. Except within string literals.

Code inside string literals is less readable and more inclined to be wrong/buggy.

I was arguing the general principle of not being afraid of premature optimization, not this particular example. You make good points.