Hacker News new | ask | show | jobs
by npsimons 4904 days ago
I do regret the ad hom, and I don't have time right now for a proper rebuttal with links to far better programmers than I who have come down on the side of spaces and no lines longer than column 80, but I'll give you this: your basic premise (the one on the end of the title and the article) are true, and is a point I fully emphasize with. To be honest, I don't really care too much what formatting is used (and I can configure my editor of choice for anything you can think of, natch), but I insist that it be consistent.

Unfortunately, we don't all get to choose who we work with or that they use a decent editor, and either one or the other are usually lacking, therefore: no tabs, only spaces. Also, if you have a line of code longer than 80 characters, consider that that's an indication that it's too complex, and not so much that it's breaking some arbitrary line length rule. Does a function really need more than three arguments? Why not put them each on a line for better readability? Do you really need to put 15 operations on one line, when the compiler can inline them for you, and you can give more meaningful names to constant temporary variables?

As for putting all code in one function (or even one file), I thought it was fairly obvious: you can make things hard to read by using too long a line of code, just as you can make things hard to read by dumping them all in one unbroken file (line after line with no reuse and no compartmentalization of functionality).