Click here to Skip to main content
15,895,962 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: C# code styling Pin
lmoelleb17-Aug-21 3:15
lmoelleb17-Aug-21 3:15 
GeneralRe: C# code styling Pin
Sander Rossel16-Aug-21 19:02
professionalSander Rossel16-Aug-21 19:02 
GeneralRe: C# code styling Pin
Super Lloyd16-Aug-21 19:47
Super Lloyd16-Aug-21 19:47 
JokeRe: C# code styling Pin
Jacquers16-Aug-21 19:22
Jacquers16-Aug-21 19:22 
GeneralRe: C# code styling Pin
Super Lloyd16-Aug-21 19:46
Super Lloyd16-Aug-21 19:46 
GeneralRe: C# code styling Pin
obermd17-Aug-21 6:21
obermd17-Aug-21 6:21 
GeneralRe: C# code styling Pin
Jacquers16-Aug-21 19:25
Jacquers16-Aug-21 19:25 
GeneralRe: C# code styling Pin
lmoelleb16-Aug-21 21:57
lmoelleb16-Aug-21 21:57 
Consistency helps a bit when reading code, but it comes with two drawbacks in my view: Endless discussion and code review focusing on formatting while no-one notice the structure of the code is complete crap.

We did find a solution to this in our team. A bit too heavy impact to apply in old projects but for anything new we do it from the start: Analyzers.

We use Stylecop and NETAnalyzers (or whatever fxcop was renamed to.... or do we still have FXCop and it was Stylecop renamed? Who knows? Who cares?) and a few others.

We suppress some things (no file headers, no requirement to document public methods in anything but public APIs). There is no strict rule for what we suppress, but any suppression also goes through code review, and typically "this adds a lot of work and no benefit" will be accepted while "it looks better this way" is unlikely to get through - at least as a global suppression.

In the start there is the usual complains about prefixing with "this." and placing using statements inside the namespace declaration. Luckily there is a solution: Simply say "sure, we can change it if you don't like it, just try doing it 3-6 months then we will discuss what we want to change. Most will live with this "mandate" form a senior. After all, in 3-6 months they will have the discussion and they can get this stupidity changed.... Then after 3-6 months, they realized it just doesn't matter and don't want to change anything.

Set the release build to treat warnings like errors - and force a build on merge to "develop" or whatever branch you use and formatting is "just taken care of" by tools as it should be.
GeneralRe: C# code styling Pin
#realJSOP16-Aug-21 23:33
professional#realJSOP16-Aug-21 23:33 
GeneralRe: C# code styling Pin
lmoelleb17-Aug-21 3:03
lmoelleb17-Aug-21 3:03 
GeneralRe: C# code styling Pin
#realJSOP17-Aug-21 23:10
professional#realJSOP17-Aug-21 23:10 
GeneralRe: C# code styling Pin
lmoelleb17-Aug-21 23:23
lmoelleb17-Aug-21 23:23 
GeneralCP handy for lots of stuff (even programming info) Pin
theoldfool16-Aug-21 7:28
professionaltheoldfool16-Aug-21 7:28 
GeneralRe: CP handy for lots of stuff (even programming info) Pin
OriginalGriff16-Aug-21 8:15
mveOriginalGriff16-Aug-21 8:15 
GeneralRe: CP handy for lots of stuff (even programming info) Pin
theoldfool16-Aug-21 8:48
professionaltheoldfool16-Aug-21 8:48 
GeneralRe: CP handy for lots of stuff (even programming info) Pin
Slow Eddie16-Aug-21 11:54
professionalSlow Eddie16-Aug-21 11:54 
GeneralRe: CP handy for lots of stuff (even programming info) Pin
theoldfool16-Aug-21 12:36
professionaltheoldfool16-Aug-21 12:36 
GeneralRe: CP handy for lots of stuff (even programming info) Pin
Slow Eddie17-Aug-21 2:07
professionalSlow Eddie17-Aug-21 2:07 
GeneralRe: CP handy for lots of stuff (even programming info) Pin
theoldfool17-Aug-21 2:17
professionaltheoldfool17-Aug-21 2:17 
GeneralThought of the Day Pin
OriginalGriff16-Aug-21 5:52
mveOriginalGriff16-Aug-21 5:52 
GeneralRe: Thought of the Day Pin
jeron116-Aug-21 6:00
jeron116-Aug-21 6:00 
GeneralRe: Thought of the Day Pin
fgs196316-Aug-21 6:46
fgs196316-Aug-21 6:46 
GeneralRe: Thought of the Day Pin
jeron116-Aug-21 7:27
jeron116-Aug-21 7:27 
GeneralRe: Thought of the Day Pin
fgs196316-Aug-21 9:19
fgs196316-Aug-21 9:19 
GeneralRe: Thought of the Day Pin
obermd16-Aug-21 9:23
obermd16-Aug-21 9:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.