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

I think the accepted standard for "code length" is about the number of tokens used, not the number of characters (or at least should be). So no points for replacing readable identifiers with random punctuation or one character variable names. And comments don't count towards the length either! :)

> I once saw “half = num >> 1” instead of, say, “half = floor(num / 2)”.

Again, that's just stuff that's getting you a small constant factor less code, a few characters here and there. To get closer to an order of magnitude smaller program solving the same problem requires a deeper understanding of the problem and different strategies for solving it.

To me, the gold standard example for the 10x to 100x coder is always Peter Norvig.

https://norvig.com/spell-correct.html https://norvig.com/sudoku.html

Notice the clear comments and detailed explanations and reasonable identifier names. But do you think the median developer would solve these problems with a similar amount of actual code?



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

Search: