Click here to Skip to main content
15,895,841 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: Pet Peeve Pin
Jeremy Falcon11-Dec-14 4:56
professionalJeremy Falcon11-Dec-14 4:56 
GeneralRe: Pet Peeve Pin
R. Giskard Reventlov10-Dec-14 11:14
R. Giskard Reventlov10-Dec-14 11:14 
GeneralRe: Pet Peeve Pin
Jeremy Falcon10-Dec-14 11:16
professionalJeremy Falcon10-Dec-14 11:16 
GeneralRe: Pet Peeve Pin
R. Giskard Reventlov10-Dec-14 11:22
R. Giskard Reventlov10-Dec-14 11:22 
GeneralRe: Pet Peeve Pin
Jeremy Falcon10-Dec-14 11:25
professionalJeremy Falcon10-Dec-14 11:25 
GeneralRe: Pet Peeve Pin
ronchristie11-Dec-14 9:59
ronchristie11-Dec-14 9:59 
GeneralRe: Pet Peeve Pin
Jeremy Falcon11-Dec-14 10:08
professionalJeremy Falcon11-Dec-14 10:08 
GeneralRe: Pet Peeve Pin
rjmoses12-Dec-14 10:18
professionalrjmoses12-Dec-14 10:18 
I personally prefer this convention:

if ((a cond b) conjunction
(c cond d) conjunction // Additional conditions always on separate line
(e cond f)) { // Always include opening brace
do .... something
} // Always closing brace

Or
} else { // Always closing brace..else..opening brace
do .... something else
} // Always closing brace

The same conventions and principles apply to loops (for, while, etc.) and other conditionals.

I strictly avoid NOT using braces under any circumstances.

I want to be able to see a complete thought, i.e., a block of code, in one intact, obvious section.

These are my thoughts based on years of chasing bugs, modifying other people's code, and having to debug somebody else's problem. Other people are welcome to use their own conventions, but I may not be able to help them efficiently.

Just because I can do something doesn't mean I should do it.
GeneralRe: Pet Peeve Pin
ronchristie13-Dec-14 9:04
ronchristie13-Dec-14 9:04 
GeneralRe: Pet Peeve PinPopular
Tom Clement10-Dec-14 10:23
professionalTom Clement10-Dec-14 10:23 
GeneralRe: Pet Peeve Pin
Jeremy Falcon10-Dec-14 10:25
professionalJeremy Falcon10-Dec-14 10:25 
GeneralRe: Pet Peeve PinPopular
Maximilien10-Dec-14 10:26
Maximilien10-Dec-14 10:26 
GeneralRe: Pet Peeve Pin
Mike Hankey10-Dec-14 10:33
mveMike Hankey10-Dec-14 10:33 
GeneralRe: Pet Peeve Pin
Dan Neely10-Dec-14 10:56
Dan Neely10-Dec-14 10:56 
GeneralRe: Pet Peeve Pin
Ian Shlasko10-Dec-14 11:09
Ian Shlasko10-Dec-14 11:09 
GeneralRe: Pet Peeve Pin
Jeremy Falcon10-Dec-14 11:21
professionalJeremy Falcon10-Dec-14 11:21 
GeneralRe: Pet Peeve Pin
kmoorevs10-Dec-14 11:28
kmoorevs10-Dec-14 11:28 
GeneralRe: Pet Peeve Pin
Jeremy Falcon10-Dec-14 11:46
professionalJeremy Falcon10-Dec-14 11:46 
GeneralRe: Pet Peeve Pin
kmoorevs10-Dec-14 11:49
kmoorevs10-Dec-14 11:49 
GeneralRe: Pet Peeve Pin
Mladen Janković10-Dec-14 12:11
Mladen Janković10-Dec-14 12:11 
GeneralRe: Pet Peeve Pin
enhzflep10-Dec-14 14:15
enhzflep10-Dec-14 14:15 
GeneralRe: Pet Peeve Pin
R. Giskard Reventlov10-Dec-14 15:12
R. Giskard Reventlov10-Dec-14 15:12 
GeneralRe: Pet Peeve Pin
Mladen Janković10-Dec-14 23:25
Mladen Janković10-Dec-14 23:25 
QuestionRe: Pet Peeve Pin
Eddy Vluggen10-Dec-14 12:24
professionalEddy Vluggen10-Dec-14 12:24 
AnswerRe: Pet Peeve Pin
Xmen Real 10-Dec-14 16:10
professional Xmen Real 10-Dec-14 16: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.