Click here to Skip to main content
15,895,192 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: CCC Pin
pkfox16-Aug-21 23:03
professionalpkfox16-Aug-21 23:03 
GeneralThe TDWTF commentariat nails it again PinPopular
Dan Neely16-Aug-21 17:25
Dan Neely16-Aug-21 17:25 
GeneralC# code styling Pin
Super Lloyd16-Aug-21 16:44
Super Lloyd16-Aug-21 16:44 
GeneralRe: C# code styling Pin
PIEBALDconsult16-Aug-21 16:57
mvePIEBALDconsult16-Aug-21 16:57 
GeneralRe: C# code styling Pin
obermd16-Aug-21 17:21
obermd16-Aug-21 17:21 
GeneralRe: C# code styling Pin
Super Lloyd16-Aug-21 17:36
Super Lloyd16-Aug-21 17:36 
GeneralRe: C# code styling Pin
lmoelleb16-Aug-21 22:36
lmoelleb16-Aug-21 22:36 
GeneralRe: C# code styling Pin
#realJSOP16-Aug-21 23:28
mve#realJSOP16-Aug-21 23:28 
0) If I'm editing an existing file, I follow the formatting already in that file. If I'm creating a new file - in the absence of established corporate coding standards - I use my own style.

1) I never reformat a file to my style because source control would mark every line as being changed when I checked it back in.

2) I always put accessors on private elements.

3) I always use this., or in the case of static classes, I use ClassName. to denote local class members.

4) I use lowercase chars to start field/method variable names, and camel-case them if necessary.

5) I start class, property, and method names with uppercase chars, and camel-case them if necessary.

6) I put curly braces on their own lines.

7) I'm a fanatic for code alignment.

8) I use LINQ when it makes sense to do so, mostly because it cleans up the code so well without loosing fidelity.

9) I "keep tabs". After I demonstrated why to the rest of the team, they agree it's the best way to go. We have one guy that was doing 5 spaces instead of four when he hit the tab key. This helped him immensely because VS uses five spaces for him, and four for the rest of us.

10) I comment pretty much everything, at least the "why" of it.

Fortunately, I'm currently in a position where I can dictate styling for my team. Even more fortunate, they already used pretty much the same styling techniques.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

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 
GeneralRe: C# code styling Pin
#realJSOP16-Aug-21 23:33
mve#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
mve#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 

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.