Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As always, https://xkcd.com/1205/ is a great reference to keep in mind.

That said, most developers (I assume, by most I mean myself) never work with code where the work they do has any serious impact on performance; it's layers on top of code that should be fast, but the work I do is implementing business logic and screens, in which case readability vastly trumps performance.

I mean right now I'm writing a line of code that can be represented as a nested ternary or a function call with some more written-out if/elses. The ternary outperforms the function call 2:1 or more, but either one can be executed hundreds of times a second BUT will only be executed once or twice per page view. It's not worth the tradeoff, even if this line of code will be executed hundreds of millions of times overall.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: