Click here to Skip to main content
15,913,055 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: Javascript brace style - THAT discussion probably again Pin
Gary Wheeler20-Nov-17 1:11
Gary Wheeler20-Nov-17 1:11 
GeneralRe: Javascript brace style - THAT discussion probably again Pin
Dan Neely20-Nov-17 2:50
Dan Neely20-Nov-17 2:50 
GeneralRe: Javascript brace style - THAT discussion probably again Pin
Gary Wheeler20-Nov-17 2:53
Gary Wheeler20-Nov-17 2:53 
GeneralRe: Javascript brace style - THAT discussion probably again Pin
joebrown.org.uk20-Nov-17 5:55
joebrown.org.uk20-Nov-17 5:55 
AnswerRe: Guess what, that site is just wrong. Pin
Jeremy Falcon17-Nov-17 7:08
professionalJeremy Falcon17-Nov-17 7:08 
GeneralRe: Guess what, that site is just wrong. Pin
Marc Clifton17-Nov-17 7:59
mvaMarc Clifton17-Nov-17 7:59 
GeneralRe: Guess what, that site is just wrong. Pin
Jeremy Falcon17-Nov-17 8:25
professionalJeremy Falcon17-Nov-17 8:25 
GeneralRe: Guess what, that site is just wrong. Pin
jsc4218-Nov-17 0:14
professionaljsc4218-Nov-17 0:14 
TOOTBS (aka K&R) is only about layout of statements. It gets confused with object literals purely because they use braces but for an entirely different purpose; same as '(' and ')' have multiple uses, as does the ','. That, combined with the lazy end of statement convention, is the only rationale for using TOOTBS. But you can use logical aligned braces even when returning objects either by making them subexpressions (using one of the alternative uses of '(' and ')') or by converting the object to a named object. Viz:
JavaScript
return (
   { 
      p1: 1,
      p2: 2
   });
// or (my preference)
var result =
   { 
      p1: 1,
      p2: 2
   };

return result;

GeneralRe: Guess what, that site is just wrong. Pin
Jeremy Falcon18-Nov-17 5:25
professionalJeremy Falcon18-Nov-17 5:25 
GeneralRe: Guess what, that site is just wrong. Pin
Jeremy Falcon18-Nov-17 5:27
professionalJeremy Falcon18-Nov-17 5:27 
GeneralRe: Javascript brace style - THAT discussion probably again Pin
PIEBALDconsult17-Nov-17 9:27
mvePIEBALDconsult17-Nov-17 9:27 
GeneralRe: Javascript brace style - THAT discussion probably again Pin
EbenRoux19-Nov-17 20:32
EbenRoux19-Nov-17 20:32 
GeneralRe: Javascript brace style - THAT discussion probably again Pin
John Bevan19-Nov-17 23:40
John Bevan19-Nov-17 23:40 
GeneralRe: Javascript brace style - THAT discussion probably again Pin
who_me20-Nov-17 3:15
who_me20-Nov-17 3:15 
GeneralRe: Javascript brace style - THAT discussion probably again Pin
Dimitrios Kalemis20-Nov-17 10:25
Dimitrios Kalemis20-Nov-17 10:25 
GeneralRe: Javascript brace style - THAT discussion probably again Pin
obermd20-Nov-17 14:54
obermd20-Nov-17 14:54 
GeneralThought of the Day Pin
OriginalGriff17-Nov-17 4:52
mveOriginalGriff17-Nov-17 4:52 
GeneralRe: Thought of the Day Pin
lopatir17-Nov-17 5:03
lopatir17-Nov-17 5:03 
GeneralRe: Thought of the Day Pin
megaadam17-Nov-17 5:08
professionalmegaadam17-Nov-17 5:08 
GeneralRe: Thought of the Day Pin
W Balboos, GHB17-Nov-17 5:11
W Balboos, GHB17-Nov-17 5:11 
GeneralRe: Thought of the Day Pin
Eddy Vluggen17-Nov-17 5:16
professionalEddy Vluggen17-Nov-17 5:16 
GeneralRe: Thought of the Day Pin
jeron117-Nov-17 5:29
jeron117-Nov-17 5:29 
GeneralRe: Thought of the Day Pin
Ravi Bhavnani17-Nov-17 10:24
professionalRavi Bhavnani17-Nov-17 10:24 
GeneralRe: Thought of the Day Pin
jeron117-Nov-17 12:07
jeron117-Nov-17 12:07 
GeneralRe: Thought of the Day Pin
Ravi Bhavnani18-Nov-17 8:30
professionalRavi Bhavnani18-Nov-17 8:30 

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.