Click here to Skip to main content
15,914,111 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.

 
JokeRe: Coding Standards Pin
Richard Deeming13-Feb-14 3:43
mveRichard Deeming13-Feb-14 3:43 
GeneralRe: Coding Standards Pin
Matt U.13-Feb-14 4:30
Matt U.13-Feb-14 4:30 
GeneralRe: Coding Standards Pin
Jonathan C Dickinson13-Feb-14 21:44
Jonathan C Dickinson13-Feb-14 21:44 
GeneralRe: Coding Standards Pin
Richard Deeming14-Feb-14 0:27
mveRichard Deeming14-Feb-14 0:27 
GeneralRe: Coding Standards PinPopular
Pete O'Hanlon13-Feb-14 3:45
mvePete O'Hanlon13-Feb-14 3:45 
GeneralRe: Coding Standards Pin
MarkTJohnson13-Feb-14 3:50
professionalMarkTJohnson13-Feb-14 3:50 
GeneralRe: Coding Standards Pin
HobbyProggy13-Feb-14 3:58
professionalHobbyProggy13-Feb-14 3:58 
GeneralRe: Coding Standards Pin
wout de zeeuw13-Feb-14 3:58
wout de zeeuw13-Feb-14 3:58 
Ideally, every coding standard rule will have a rationale as to what benefit the rule brings.

Variables should be defined as close to their first use as possible in general. If they are re-used several times, I always redeclare them every time in a new {} block within the method to not accidentally re-use a value from the previous block.

Those comments are silly, you are exaggerating there, right? If not, the comments are such that you could possibly generate them with a tool (think of e.g. GhostDoc). It would even be a nice exercise to write such a tool! Smile | :)

Edit: code comment should mostly explain why something is being done, not what is being done, because the what is mostly self explanatory, or can be found out using debugging. The why is very hard to find out.
Wout


modified 13-Feb-14 10:40am.

GeneralRe: Coding Standards Pin
Matt U.13-Feb-14 4:32
Matt U.13-Feb-14 4:32 
GeneralRe: Coding Standards Pin
Gregory Gadow13-Feb-14 4:16
Gregory Gadow13-Feb-14 4:16 
GeneralRe: Coding Standards Pin
wout de zeeuw13-Feb-14 4:26
wout de zeeuw13-Feb-14 4:26 
GeneralRe: Coding Standards Pin
Member 1008817113-Feb-14 8:54
Member 1008817113-Feb-14 8:54 
GeneralRe: Coding Standards Pin
jschell13-Feb-14 9:12
jschell13-Feb-14 9:12 
GeneralRe: Coding Standards Pin
Member 1008817113-Feb-14 9:35
Member 1008817113-Feb-14 9:35 
GeneralRe: Coding Standards Pin
jschell14-Feb-14 10:16
jschell14-Feb-14 10:16 
GeneralRe: Coding Standards Pin
S Houghtelin13-Feb-14 4:29
professionalS Houghtelin13-Feb-14 4:29 
AnswerRe: Coding Standards Pin
Ravi Bhavnani13-Feb-14 4:39
professionalRavi Bhavnani13-Feb-14 4:39 
GeneralRe: Coding Standards Pin
Matt U.13-Feb-14 5:12
Matt U.13-Feb-14 5:12 
GeneralRe: Coding Standards Pin
Dennis E White13-Feb-14 5:23
professionalDennis E White13-Feb-14 5:23 
GeneralRe: Coding Standards Pin
Matt U.13-Feb-14 6:05
Matt U.13-Feb-14 6:05 
GeneralRe: Coding Standards Pin
jschell13-Feb-14 9:07
jschell13-Feb-14 9:07 
GeneralRe: Coding Standards Pin
Matt U.13-Feb-14 10:37
Matt U.13-Feb-14 10:37 
GeneralRe: Coding Standards Pin
Dennis E White13-Feb-14 12:52
professionalDennis E White13-Feb-14 12:52 
GeneralRe: Coding Standards Pin
jschell14-Feb-14 10:06
jschell14-Feb-14 10:06 
GeneralRe: Coding Standards Pin
Matt U.14-Feb-14 10:10
Matt U.14-Feb-14 10:10 

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.