3 ms·
I don't get why people do that. It's ugly, and it breaks when the `youCantDo` name changes. youCanDo( "this kind of", "function
by tasuki 5y ago
I don't get why people do that. It's ugly, and it breaks when the `youCantDo` name changes.
youCanDo(
"this kind of",
"function parameter",
"with just tabs"
)
- samatman 5y agoUgly is subjective. Vertical space is at a premium, and 'wasting' five lines when three will do strikes me as uglier than the opposite. Adjusting spaces when things get refactored doesn't strike me as especially tedious, but YMMV. I don't go so far as to support "lisp style" closing braces for brace-block languages, though. It's just too weird.
- twinkletwinkle_ 5y agoAgree that ugly is subjective. But adjusting spaces when things get refactored is bad, not because it's tedious but because it pollutes history. Changing whitespace on surrounding lines to my change makes eg `git blame` less informative. It's the same reason I believe in trailing commas.
- samatman 5y agoI acknowledge this problem while throwing up my hands at the incredible laziness of the entire profession in not employing syntactically-aware diffing. It's our own fault, we have no excuse, and it galls me to serve a dumb line-based algorithm over the writers and readers of my code.
- tasuki 5y agoIdeally, what is stored in version control is just the AST, and how you or I display it is up to our own preference. Then I won't have to care about your weird indentation preferences and other style choices and you won't have to care about mine!
- tasuki 5y agoAgreed fully, these are my reasons too, and I'm quite sorry for not having included a trailing comma in my example :)
- u801e 5y agoBut it does make for more compact and easier to read diffs.