IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New I'm interested in research too
so I can stop arguing this with the "wrong" people.

Sadly, I've never found any. Which seems odd as it might be fertile ground for a doctorate.

I have lots of anecdotal experience that suggests that the right style (BSD) is best though. Some of this is from teaching programming and helping students understand their programs. Often, simply fixing brace placement/reindenting gives them the insight they need to fix their programs.

Some of it is from code statement nesting errors I've either found and fixed or helped find with someone (pair debugging) who uses the wrong style (to pick a name to differentiate it from the "right" style).

I think a worthwhile experiment would be to take a bunch of source code and either double or remove braces arbitrarily, present them to developers and time how long it takes them to spot the error.



"Whenever you find you are on the side of the majority, it is time to pause and reflect"   --Mark Twain

"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."   --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."   --George W. Bush
Expand Edited by tuberculosis Oct. 31, 2005, 05:08:27 PM EST
New so K&R is wrong? Heretic BURN HIM!
"the reason people don't buy conspiracy theories is that they think conspiracy means everyone is on the same program. Thats not how it works. Everybody has a different program. They just all want the same guy dead. Socrates was a gadfly, but I bet he took time out to screw somebodies wife" Gus Vitelli

Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free american and do not reflect the opinions of any person or company that I have had professional relations with in the past 49 years. meep
questions, help? [link|mailto:pappas@catholic.org|email pappas at catholic.org]
New :-\ufffd :-\ufffd :-\ufffd :-\ufffd
jb4
shrub●bish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT

New There's a lot of stuff at scholar.google.com
I'm not sure how well it would satisfy partisans though. I haven't come across a study of the benefits of brace placement rules, but there are things like [link|http://research.sun.com/people/mlvdv/COM.sun.mlvdv.doc.ist_02.paper_pdf.pdf|this] 17 page .pdf by Van De Vanter at Sun:

pp.1-2:

Unlike the textual representation of linguistic structure, which includes keywords, identifiers, operators, and punctuation, documentary structure consists of those textual aspects explicitly defined to be not part of the language: white space (new lines, spaces, tabs), comments, and choice of names.

Viewed differently, documentary structure is what programmers add to source code for the sole purpose of aiding the human reader. This is of enormous importance because of the central role of reading during software development [14]. Programmers clearly understand this: they arrange code carefully, complain about inadequate comments, and argue passionately about the exact placement of braces in code (purely a matter of white space in most languages).

It is almost tautological that documentary structure is outside the formal language. It is a much more subtle fact that documentary structure is mostly orthogonal to language structure. An important consequence is that compiler-oriented tools do not represent documentary structure adequately. Compilers discard this information freely because it is not needed: humans seldom read compiler output. For other language-based tools, however, losing documentary structure violates the tool builder\ufffds equivalent of the physician\ufffds oath to \ufffdfirst do no harm.\ufffd


Cheers,
Scott.
New I think it depends on your visual habits.
I'm into white-space and correct indents, so I use the K&R brace-style. It also means I like spaces around my = signs, and after commas and around expressions in if, while, switch, etc.

And I know I'm extremely partial to Vim's syntax highlighting... :-)

Wade.
"Insert crowbar. Apply force."
     Checking for the existence of a directory in Perl - (pwhysall) - (53)
         I use: - (admin) - (52)
             Context - (pwhysall) - (51)
                 Re: Context - (admin) - (5)
                     Moochos grassy arse. -NT - (pwhysall)
                     And I would point out that... - (ben_tilly) - (3)
                         How to do that... - (admin) - (2)
                             That works but... - (ben_tilly) - (1)
                                 Ah, good. Thanks. -NT - (admin)
                 Minor points - (ben_tilly) - (44)
                     Re: Minor points - (pwhysall)
                     Slightly OT: on brace style: - (admin) - (42)
                         That's what I've been doing, but I'm a noob. - (Another Scott)
                         No way, this is the shizzit - (jake123)
                         Yes, that is the correct form - (tuberculosis)
                         I've heard arguments for and against that - (ben_tilly) - (38)
                             The arguments are simple - (tuberculosis) - (13)
                                 Ah, an open mind. - (Yendor) - (1)
                                     Yeah, but he's right. - (pwhysall)
                                 Yes, we know you're strongly imprinted - (ben_tilly) - (10)
                                     I'm interested in research too - (tuberculosis) - (4)
                                         so K&R is wrong? Heretic BURN HIM! -NT - (boxley) - (1)
                                             :-\ufffd :-\ufffd :-\ufffd :-\ufffd -NT - (jb4)
                                         There's a lot of stuff at scholar.google.com - (Another Scott)
                                         I think it depends on your visual habits. - (static)
                                     Sidenote - (Simon_Jester) - (4)
                                         Automate that Jalopy - (Yendor) - (2)
                                             That's okay... - (Simon_Jester) - (1)
                                                 np - (Yendor)
                                         Yes, that's a PBP recommend :-) - (ben_tilly)
                             I'm seeing comments that "Code Complete" addresses that - (Another Scott) - (15)
                                 Where? - (ben_tilly) - (14)
                                     CC2, pp 740-743 -NT - (Yendor) - (3)
                                         I should finish reading it then - (ben_tilly) - (2)
                                             Ar - (Yendor) - (1)
                                                 I read the first one that way, the first time - (ben_tilly)
                                     E.g. - (Another Scott) - (9)
                                         What I see on that page: - (admin) - (8)
                                             I see. - (Another Scott) - (7)
                                                 Dunno what to tell you... - (admin) - (2)
                                                     www.mr-anderson.net could not be found... - (Another Scott) - (1)
                                                         Can you dig it? - (pwhysall)
                                                 They work here. Check your browser/adblock. -NT - (pwhysall)
                                                 For some reason reading text isn't so bad. - (admin) - (2)
                                                     Would you be better off wearing a patch? -NT - (broomberg) - (1)
                                                         Tried that for a bit. - (admin)
                             It's not just "bad vision" - (admin) - (5)
                                 I'm *so* playing you at pool, for money. -NT - (pwhysall) - (4)
                                     Bastard. - (admin) - (1)
                                         :-D -NT - (Another Scott)
                                     ICLRPD: I'm *so* playing you at pool, for money. (new thread) - (Steve Lowe)
                                     You're English. Isn't that advantage enough? -NT - (ben_tilly)
                             It's a pretty print problem... - (ChrisR) - (1)
                                 Code Complete reserves special criticism for that one -NT - (ben_tilly)

This is the price one pays for eating human flesh.
79 ms