Hacker News new | ask | show | jobs
by JackK 4248 days ago
Processor time is increasingly fast enough to allow us the once-upon-a-time luxury of considering the programmer's time.

Interpreters make the inner loop of the programmer's life faster, making program development faster.

Once the program works, a profiler can be applied, and only the very slowest things recoded in lower-level language.

For many projects, optimization is not necessary at all.

Even in Donald Knuth's time, "Premature optimization is the root of all evil," was a common caution. Modern hardware makes this even more true today.

Not to say that you should go out of your way to code clumsily, but that shaving a cycle here and there anywhere but the innermost of loops is likely to be a waste of the only time that is really precious any more... your own time writing the code.

Given the amount of time code spends in maintenance, taking the time to write clear code will save the maintainer (possibly you!) time, so readability should be prized over raw execution speed in almost all cases. In six months, you won't remember how that tricky one-liner really works, and will waste reading time in minutes to hours that saved microseconds in execution.

1 comments

Readability of the syntax of a language has nothing to do with whether it is interpreted or compiled. For example: Javascript used to be interpreted in browsers. Now it is typically JIT compiled. It hasn't changed the readability of Javascript the language at all.