Hacker News new | ask | show | jobs
by teddyh 1737 days ago
> Programmers need to stop assuming that every situation is scale- and convenience-invariant.

I’ve seen it termed the “All Ns are equally likely” fallacy. I.e. when programmers write code, they know that they should write different code for when N is 0, for when N is 1, but as soon as it goes higher, most programmers tend to write code which is optimized for arbitrary values of N, even though in actual practice N might almost always be, say, at most 10. This often leads to inefficient and overcomplicated code, where a simpler algorithm might be faster most of the time while still able to correctly, if more slowly, deal with non-typical values of N.