Style Poll
-
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 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.
-
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
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 -
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. However, there are a couple cases where I stray, such as private string _MyString; public string MyStringProperty { get { return _MyString; } set { _MyString; } } of course, if there is more than 1 line in the get or set I expand it.
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startBrace yourself - I use mostly A. I use B if: a. I need readability (eg lots of nested blocks) b. I'm working with someone else's code, and its B. c. I hit enter by mistake. Somtimes I use C. So, in brief ?abc : B, (A || C) Or A before B except after abc. See? Simple really. Once you get the 'hang' of it. In any case, those were my indentions.
-
B 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 HoldsworthJoel Holdsworth wrote:
if(whatever)
Hmmm, it all looks red to me. ;P Regards, Alvaro
"I do" is both the shortest and the longest sentence in the English language.
-
Brace yourself - I use mostly A. I use B if: a. I need readability (eg lots of nested blocks) b. I'm working with someone else's code, and its B. c. I hit enter by mistake. Somtimes I use C. So, in brief ?abc : B, (A || C) Or A before B except after abc. See? Simple really. Once you get the 'hang' of it. In any case, those were my indentions.
Tim Deveaux wrote: I use B if: a. I need readability (eg lots of nested blocks) Code should always be readable. Vikram.
Shameless plug: http://www.geocities.com/vpunathambekar "And above all, watch with glittering eyes the world around you because the greatest secrets are always hidden in the most unlikely places. Those who don't believe in magic will never find it." - Roald Dahl. Mrs. Schroedinger: "Erwin, what have you been doing to the cat? It looks half-dead!"
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startWho is the jack--- voting everyone down who says "B" is the best, but won't post a message saying why "A" is better??? I have only seen 1 message in support of A, and it is only partial support. Whoever you are, stop being childish, if you like "A", post a message and say why you like it, just as the rest of us have done! "I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
-
Brace yourself - I use mostly A. I use B if: a. I need readability (eg lots of nested blocks) b. I'm working with someone else's code, and its B. c. I hit enter by mistake. Somtimes I use C. So, in brief ?abc : B, (A || C) Or A before B except after abc. See? Simple really. Once you get the 'hang' of it. In any case, those were my indentions.
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startB. I think people who use A should be flogged and committed to an asylum. Or forced to code in VB. :-D Vikram.
Shameless plug: http://www.geocities.com/vpunathambekar "And above all, watch with glittering eyes the world around you because the greatest secrets are always hidden in the most unlikely places. Those who don't believe in magic will never find it." - Roald Dahl. Mrs. Schroedinger: "Erwin, what have you been doing to the cat? It looks half-dead!"
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startI have used style B since day one.
A rich person is not the one who has the most, but the one that needs the least.
-
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
Michael P Butler wrote: 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. Indeed, that's what most supporters of style A say as well. Nothing wrong with that, but I still believe that style was from a time long ago, when screens were only 25 lines long, and a lot of code was printed in books, and space was a premium. Just a guess, though. Michael P Butler wrote: 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 Yeah, I suppose I learned C/C++ during the "transition" period... and it was quite a religious issue as to what style was better. "I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
-
Joel Holdsworth wrote:
if(whatever)
Hmmm, it all looks red to me. ;P Regards, Alvaro
"I do" is both the shortest and the longest sentence in the English language.