Click here to Skip to main content
15,901,284 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
kalberts4-Mar-20 4:41
kalberts4-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
Stefan_Lang4-Mar-20 21:32 
GeneralRe: Tabs Pin
KLSmith5-Mar-20 5:15
KLSmith5-Mar-20 5:15 
GeneralRe: Tabs Pin
Kirk 103898216-Mar-20 3:59
Kirk 103898216-Mar-20 3:59 
GeneralRe: Tabs Pin
BillWoodruff3-Mar-20 22:29
professionalBillWoodruff3-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
W 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
kalberts4-Mar-20 2:51
kalberts4-Mar-20 2:51 
GeneralRe: Tabs Pin
W Balboos, GHB4-Mar-20 5:08
W Balboos, GHB4-Mar-20 5:08 
GeneralRe: Tabs Pin
kalberts4-Mar-20 12:25
kalberts4-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
FormerBIOSGuy6-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
Dan Neely4-Mar-20 3:30 
JokeRe: Tabs Pin
W Balboos, GHB4-Mar-20 5:05
W 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
Stefan_Lang4-Mar-20 21:44 
GeneralRe: Tabs Pin
W Balboos, GHB5-Mar-20 1:18
W 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
agolddog5-Mar-20 4:13 
GeneralRe: Tabs Pin
Bitbeisser5-Mar-20 7:18
Bitbeisser5-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.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   504 votes