▲ | austin-cheney 4 days ago | ||||||||||||||||
Yes, everyone has personal opinions about code vanity. When this becomes a holy war I really start to question the maturity of people on the project. I find that people worry about trivial nonsense to mask their inability to address more valid concerns. All that really matters is consistency. Let a team make some decisions and then just move forward. | |||||||||||||||||
▲ | 2muchcoffeeman 4 days ago | parent | next [-] | ||||||||||||||||
Don’t bother making decisions. Steal a standard. Vote on it once if you want to be democratic. Done forever. | |||||||||||||||||
| |||||||||||||||||
▲ | socalgal2 3 days ago | parent | prev | next [-] | ||||||||||||||||
> All that really matters is consistency And this is my problem. My last example, the 2 styles are inconsistent. So when the guideline is "all that matters in consistency" then I take that at face value. You though apparently pull back and believe something more messy. Effectively "All that really matters is a consistently applied style even if that style itself is full of inconsistency" The same applies to the trailing commas. With them, every line is consistent. Without, the last line is inconsistent with the other lines. So are we applying this rule "All that really matters is consistency" or only applying it sometimes? I would argue whatever heuristic made you say "All that really matters is consistency" should apply to both cases. Consistently apply a style guide and, the style guide itself should be consistent. | |||||||||||||||||
| |||||||||||||||||
▲ | ParetoOptimal 3 days ago | parent | prev | next [-] | ||||||||||||||||
> All that really matters is consistency. Let a team make some decisions and then just move forward. Not so! Amount of tokens correlates to perceived code complexity to some. One example is how some people can't unsee or look past lisps parenthesis. Another example is how some people get used to longDescriptiveVariableNames but others find that overwhelming (me for instance) when you have something like:
Above isn't bad, but imagine variables named that verbosely used over and over, esp in same line.Compare it to:
The second example loses some information, but I'd argue it doesn't matter too much given the context one would typically have in a function named `userSignup`.I've had codebases where consistency required naming all variables like `firstNameInputField` rather than just `firstName` and it made functions unreadable because it made the unimportant parts seem more important than they were simply by taking up more space. | |||||||||||||||||
▲ | parthdesai 3 days ago | parent | prev [-] | ||||||||||||||||
It's one of my pet peeves when some senior engineers are bothered more by these coding semantics in a PR when there are bigger data model/code architectural issues, and don't call that out. |