Style Poll
-
B. 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!"
Vikram Punathambekar wrote: Or forced to code in VB. :growl: I'm suffering a worse fate. Try Powerbuilder. :mad: X| -- Meine Welt ist monoton und minimal, doch ganz total!
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startA of course. Gives me vertical space to separate logical chunks of code, without losing "code density". I only do B for outmost scopes/blocks. -- Meine Welt ist monoton und minimal, doch ganz total!
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startA from habit but since theres so many voting B I may change due to peer group pressure or maybe I'll always be a rebel.:confused:
The smaller the mind the greater the conceit. Aesop
-
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: but i don't understand how anyone could mistaxe if(whatever) for a function call :) I don't put the space between "if" and the opening bracket as well, I don't like it. ;) rado
Radoslav Bielik http://www.neomyz.com/poll [^] - Get your own web poll
-
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: i don't understand how anyone could mistaxe if(whatever) for a function call especially as the if turns a blue colour! Well, it turns blue in Visual Studio but not necessarily if you are doing C programming on a system running Solaris.:) Brad Jennings Sonork: 100.36360 AIM: hongg99
-
A from habit but since theres so many voting B I may change due to peer group pressure or maybe I'll always be a rebel.:confused:
The smaller the mind the greater the conceit. Aesop
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startI used A for about the first 4 months (it's what our teacher taught us) and then I had a programming partner that really hated A so I was converted to B. I use B even if the conditional statement is a one-liner:
if(true) { DoSomething(); }
Also, as far as indentation goes, I used to use tabs everywhere but the TA for one of my classes last year broke me of that and now I use 4 spaces. Brad Jennings Sonork: 100.36360 AIM: hongg99
-
Well, one reason for this (and I used to do it) was due to screen size .... ever program with CGA graphics (320x200 pixels, 40x25 in text). So ya, for those of us who have been doing it long enough to still remember writing DOS TSRs had to write C++ code this way. Troy
-
Once you've started doing "B", you'll never look back, and wonder why you ever coded with "A" at all. :cool: "I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
I've seen the light, I'm going to give it a try :-D
The smaller the mind the greater the conceit. Aesop
-
Well, one reason for this (and I used to do it) was due to screen size .... ever program with CGA graphics (320x200 pixels, 40x25 in text). So ya, for those of us who have been doing it long enough to still remember writing DOS TSRs had to write C++ code this way. Troy
Yes, I remember writing them with monochrome screens, but they were 80x25 in size.
A rich person is not the one who has the most, but the one that needs the least.
-
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
startWell... since nobody does, I dare to say I use and prefer A. I find it MUCH more readable, uses less screen space (we all know what a screen-eater is VS), and I save an Enter at each indent. When I need to underline the bracket of course B is the way to go, but often simple indentation is enough. Oh, and one last thing: for function definitions A is my preferred way. Example:
void DailyPrayer(int times)
{
for (int i = 0; i < times; ++i) {
printf("I love CP\r\n");
printf("And you?\r\n");
}for (int i = 0; i < times; ++i) printf("http://www.codeproject.com");
}
Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startI use B, always have, always will ( well, not really, I believe having a standard is more important than it's details, I would follow any standard my employer set ). But I'm curious about a few things 1. With two simple choices, why was this not a 'vote 5 for, vote 1 for' poll, and 2. Why is it that every post on this thread that I look at has been voted for twice and has a score of 3 ? Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
-
I use B, always have, always will ( well, not really, I believe having a standard is more important than it's details, I would follow any standard my employer set ). But I'm curious about a few things 1. With two simple choices, why was this not a 'vote 5 for, vote 1 for' poll, and 2. Why is it that every post on this thread that I look at has been voted for twice and has a score of 3 ? Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
Christian Graus wrote: 2. Why is it that every post on this thread that I look at has been voted for twice and has a score of 3 ? See a post I made a little while ago, some spineless coward voted all the posts in favor of "B" a 1. So I went and voted them a 5, just so they weren't all at 1. "I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
-
Christian Graus wrote: 2. Why is it that every post on this thread that I look at has been voted for twice and has a score of 3 ? See a post I made a little while ago, some spineless coward voted all the posts in favor of "B" a 1. So I went and voted them a 5, just so they weren't all at 1. "I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
Ah... I guess it's almost as if I was right when I said that post voting sucks :-) Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
-
How do you guys bracket your code? A:
if(true){
DoSomething();
DoSomethingElse();
}B:
if(true)
{
DoSomething();
DoSomethingElse();
}C: Other ~Nitron.
ññòòïðïðB A
startB ! The tigress is here :-D
-
Once you've started doing "B", you'll never look back, and wonder why you ever coded with "A" at all. :cool: "I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
*Elaine nods in agreement* The tigress is here :-D
-
Once you've started doing "B", you'll never look back, and wonder why you ever coded with "A" at all. :cool: "I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
I started out with B, and ended up with A. :cool: A is truly for those who have not only seen the light, but felt it and embraced it. It's like being touched by the hand of God. Or so they say. ;) -- Meine Welt ist monoton und minimal, doch ganz total!
-
Well... since nobody does, I dare to say I use and prefer A. I find it MUCH more readable, uses less screen space (we all know what a screen-eater is VS), and I save an Enter at each indent. When I need to underline the bracket of course B is the way to go, but often simple indentation is enough. Oh, and one last thing: for function definitions A is my preferred way. Example:
void DailyPrayer(int times)
{
for (int i = 0; i < times; ++i) {
printf("I love CP\r\n");
printf("And you?\r\n");
}for (int i = 0; i < times; ++i) printf("http://www.codeproject.com");
}
Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
I would enjoy programming with you, Sir! :cool: -- Meine Welt ist monoton und minimal, doch ganz total!
-
Ah... I guess it's almost as if I was right when I said that post voting sucks :-) Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
Christian Graus wrote: Ah... I guess it's almost as if I was right when I said that post voting sucks I've said many-a-times that voting would have a tendency to suck a lot less if we could tell who the voters were and what their vote was. This anonymous voting crap is almost as bad as allowing anonymous posts in the lounge. Regards, Alvaro
"I do" is both the shortest and the longest sentence in the English language.