6. Obsession with performance

"Premature optimization is the root of all evils in programming (or almost all)." Donald Knuth, 1974

Programming has come a long way since the time of Donald Knuth, but his advice still holds true today.

If you can't measure a perceived performance issue, then it's not worth your time to try and fix it. It's important to avoid optimizing code before you even start executing it, as this can lead to wasted time and effort.

However, there are some optimization rules that you should always keep in mind when writing code. For instance, in Node.js, you can't fill the event loop and block the call stack.

It's important to remember that in the pursuit of fictional performance gains, you can end up creating real bugs in unexpected places. So, it's crucial to be mindful of optimization and to prioritize writing clean, organized code that avoids common mistakes.

Last updated