Click here to Skip to main content
14,549,480 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: Tabs Pin
Member 79891224-Mar-20 4:41
MemberMember 79891224-Mar-20 4:41 
GeneralRe: Tabs Pin
Fever9055-Mar-20 3:44
professionalFever9055-Mar-20 3:44 
GeneralRe: Tabs Pin
Stefan_Lang4-Mar-20 21:32
mveStefan_Lang4-Mar-20 21:32 
GeneralRe: Tabs Pin
KLSmith5-Mar-20 5:15
MemberKLSmith5-Mar-20 5:15 
GeneralRe: Tabs Pin
Kirk 103898216-Mar-20 3:59
MemberKirk 103898216-Mar-20 3:59 
GeneralRe: Tabs Pin
BillWoodruff3-Mar-20 22:29
mveBillWoodruff3-Mar-20 22:29 
GeneralRe: Tabs Pin
Greg Utas4-Mar-20 1:35
professionalGreg Utas4-Mar-20 1:35 
GeneralRe: Tabs Pin
W Balboos, GHB4-Mar-20 1:39
mveW Balboos, GHB4-Mar-20 1:39 
lw@zi wrote:
I was wondering why they were talking about tab = 8 spaces.
What do you mean "we" ?

For a coding application I set tab at four, or even two. It's a bit font-dependent.

As for your code sample, all eyes are different, but for your 4-space tab I'd make it:
if (true) {
    // Indent of 1 tab = 4 spaces
    if (false) {
        // some thing here
    } // if(false)
} // if(true)
I particularly draw your attention to two three conventions:

  • Opening brace on same line as conditional
  • Closing brace under begfinning of its conditional
  • Comment containing matching conditional clearly identifies the end


The labling of the closing brace is invaluable when you look at the stuff some day further along in history and need to see what's what very quickly (or at least more quickly).

Ravings en masse^
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010


modified 4-Mar-20 9:46am.

GeneralRe: Tabs Pin
Member 79891224-Mar-20 2:51
MemberMember 79891224-Mar-20 2:51 
GeneralRe: Tabs Pin
W Balboos, GHB4-Mar-20 5:08
mveW Balboos, GHB4-Mar-20 5:08 
GeneralRe: Tabs Pin
Member 79891224-Mar-20 12:25
MemberMember 79891224-Mar-20 12:25 
GeneralRe: Tabs Pin
Richard MacCutchan4-Mar-20 2:54
mveRichard MacCutchan4-Mar-20 2:54 
GeneralRe: Tabs Pin
Greg Utas4-Mar-20 3:08
professionalGreg Utas4-Mar-20 3:08 
GeneralRe: Tabs Pin
Richard MacCutchan4-Mar-20 3:34
mveRichard MacCutchan4-Mar-20 3:34 
GeneralRe: Tabs Pin
Greg Utas4-Mar-20 3:48
professionalGreg Utas4-Mar-20 3:48 
GeneralRe: Tabs Pin
FormerBIOSGuy6-Mar-20 10:47
MemberFormerBIOSGuy6-Mar-20 10:47 
GeneralRe: Tabs Pin
Greg Utas6-Mar-20 12:18
professionalGreg Utas6-Mar-20 12:18 
GeneralRe: Tabs Pin
Dan Neely4-Mar-20 3:30
MemberDan Neely4-Mar-20 3:30 
JokeRe: Tabs Pin
W Balboos, GHB4-Mar-20 5:05
mveW Balboos, GHB4-Mar-20 5:05 
GeneralRe: Tabs Pin
Richard MacCutchan4-Mar-20 5:14
mveRichard MacCutchan4-Mar-20 5:14 
GeneralRe: Tabs Pin
Stefan_Lang4-Mar-20 21:44
mveStefan_Lang4-Mar-20 21:44 
GeneralRe: Tabs Pin
W Balboos, GHB5-Mar-20 1:18
mveW Balboos, GHB5-Mar-20 1:18 
GeneralRe: Tabs Pin
englebart5-Mar-20 2:55
professionalenglebart5-Mar-20 2:55 
GeneralRe: Tabs Pin
agolddog5-Mar-20 4:13
Memberagolddog5-Mar-20 4:13 
GeneralRe: Tabs Pin
Bitbeisser5-Mar-20 7:18
MemberBitbeisser5-Mar-20 7:18 

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.