3 ms·
Nope. See https://jamesclear.com/marginal-gains https://jamesclear.com/marginal-gains Code style, or worse, programming style (See for example FreeRDP vs. rDesk
by informatimago 8y ago
Nope. See https://jamesclear.com/marginal-gains https://jamesclear.com/marginal-gains
Code style, or worse, programming style (See for example FreeRDP vs. rDesktop), or even the choice of programming language, are amongst the little details that you’d thing don’t matter, but in the end of the day, they are the 1% worsening that accumulate direly.
So, the scouts’.
- lgessler 8y agoSo, let's say that you work at an enterprise software company. Everyone writes in C#, and your team has a consistent style they stick to that is indisputably the best C# coding style. Suddenly an SVP pulls you aside and tells you you need to extend a service that team SadStyle owns and integrate it with your own team's widgets. Team SadStyle has regrettably not yet been shown the way by a C# bodhisattva and has the following inarguably egregious C# style errors in its codebase: 1. Braces open on a newline instead of on the same line 2. Profligate use of `var` for every kind of variable declaration 3. Inconsistent use of tabs and spaces 4. Anonymous functions sprinkled into the code ad hoc that are sometimes quite long You're shocked at team SadStyle's code, but you need to get some work done, quick, since a deadline is coming. So what are you going to do? If you answered "I'm going to go through and change every brace, variable declaration, and span of whitespace", I think you should maybe think more about whether this is a good use of your time.
- Thiez 8y agoNumber 1 is the official c# style though... your bodhisattva was clearly a former Java programmer. Also I can't think of a reason for not using `var` everywhere, but I suppose that was your point. Personally I try to follow the style of the existing code, but when something permamently becomes the responsibility of my team I won't hesitate to apply the style of my team to the whole thing. Most parts of the style can be applied automatically, and the parts that can't be will be applied when functional changes to that part of the code are required.
- hermitdev 8y agoYour #1 & #2 fly in the face of commonly accepted C# style. #3 is unforgivable (Personally, I prefer tabs for indentation, spaces for alignment, but consistency is key). #4 depends on the function and how/when they're used. Anonymous functions are perfectly acceptable, but yes, they shouldn't be too large.
- lgessler 8y agoWhat I was hoping to signal by using sarcastic expressions like "indisputably the best C# coding style" and "inarguably egregious" is that the notion of an objectively best style is unsupportable. Coding style is to some extent fundamentally subjective, and someone should at least think very hard about why a style they disagree with might be unexpectedly good or just a matter of aesthetic taste before "enlightening" the codebases of others.