Style Poll
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startB is clearly the correct case. I suspect the only reason anyone ever even thought about doing A is that publishers wanted code snippets to take up less space in printed books, so a lot of printed example code looked like that. :rolleyes: "I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startB.... ----------------------------------------------------------------------- Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!! :-D
-
B is clearly the correct case. I suspect the only reason anyone ever even thought about doing A is that publishers wanted code snippets to take up less space in printed books, so a lot of printed example code looked like that. :rolleyes: "I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startB, although I leave a space between the
if
and the opening parenthesis since it's not a method call. Regards, Alvaro
"I do" is both the shortest and the longest sentence in the English language.
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startActually, B, but with proper identation :-D Perl combines all the worst aspects of C and Lisp: a billion different sublanguages in one monolithic executable. It combines the power of C with the readability of PostScript. -- Jamie Zawinski
-
Actually, B, but with proper identation :-D Perl combines all the worst aspects of C and Lisp: a billion different sublanguages in one monolithic executable. It combines the power of C with the readability of PostScript. -- Jamie Zawinski
Daniel Turini wrote: Actually, B, but with proper identation So is that 2 spaces, 4 spaces, or tabs set to look like 2 or 4 spaces, as opposed to the OPs obviously wrong 3 spaces? :-D
Ian Darling "One of the few systems...which has had “no deaths” in the reliability requirements." - Michael Platt
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startB. And if (true) JustASingleMethod(); Also I tend to have a lot of catch blocks like this try { //Some code here } catch (ExceptionType) { /*Sink this type for some reason */ } catch (Exception e) { RecordGeneral(e); } -Andy Brummer
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
start -
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startI use to do this:
if(true) {
DoSomething();
DoSomethingElse();
}Now I use "B" with a 2 space indent per level. Steve
-
Nitron wrote: I see a lot of old-school c-coders using A That's because that was the original C style. As featured in The C Programming Language, Second Edition by Brian W. Kernighan and Dennis M. Ritchie. From which we all learnt our first steps into C. (Well, all us old timers anyway) Of course the better programmers did tend to migrate to the more readable 'B' style ;-) Michael But you know when the truth is told, That you can get what you want or you can just get old, Your're going to kick off before you even get halfway through. When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startB Jeremy Falcon
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startB too. Pavel Sonork 100.15206
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startUsed to do A when I was younger, but I'm using B for about two years now. :) My tab-size is set to 4, and I use the same style for single-statement ifs as Andy Brummer above. rado
Radoslav Bielik http://www.neomyz.com/poll [^] - Get your own web poll
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startB, of course; A is unreadable.
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
start -
B is clearly the correct case. I suspect the only reason anyone ever even thought about doing A is that publishers wanted code snippets to take up less space in printed books, so a lot of printed example code looked like that. :rolleyes: "I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
start -
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startB of course - but i don't understand how anyone could mistaxe
if(_whatever_)
for a function call especially as theif
turns a blue colour! Joel Holdsworth -
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
start