I'll go with too, two
for(x=0;x<5;x++)
for (x = 0; x < 5; x++)
for ( x = 0 ; x < 5 ; x++ )
Well, I think it's ananomys. #2 is the best and most used.
well, it must change depending where you live on: everyone I know (who knows programming), uses #1
Oskilian
ok i have been programming since before you people knew what it was...ok some of you anyway, ok about 3 of you, but i've been programming for at least (and i can't even remember since my brain is on fire right now...) 3+ years and i've read code from most of the damn Guru's and about a million other people and heres my opinion,including my own
#1 error prone during reading, you might miss something
#2 just right everythings clear and plain, and it can be read quickly.
#3 over spaced, makes it harder to read.
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
Listen to no-one. He knows what he's talking about. #2 is just the perfect coding practice.
I agree, #2 is the nicest, but I've grown with #1, so there's nothing I can do about it
By the way, you did programming since 3+ (is that 18?), were you doing Logo?
Oskilian
Hey, all of you of this thread. Go to the C board and look at the thread entitled "Interesting little exercise...". There is this Unregistered guy that is attacking me. I am just trying to help and he is critisizing me out of no where. Can I get a mod here to do something? Thanks.
Never mind. A false alarm. He was just sticking up for me. I feel stupid.
>
By the way, you did programming since 3+ (is that 18?), were you doing Logo?
<
what...huh.
i said i've been programming for 3+(eg. 3 or more) years, but as for languages i was refering to C/C++.
I use #1, it is fast, but you are right, you can miss something while debugging, but if you learned in a way, why would you change it?
Camilo
no, life is nice, just a girl fooling around, alcohol fixes everything.
OH, I now have a High School Diploma and need of ron (drink)
i had to change to 2 from 1. i also changed from adding more whitespace to my code to increase readability... however. what about this case?
i end up doing the first, but like to do the second since it seems more readable... however contradictory... so the point being the nested parenthesis...Code:if ((a - b) == (c - d)); *or* if ( (a - b) == (c - d) );
hasafraggin shizigishin oppashigger...
I use #2. Not too much whitespace, not too little. I do vary my practices when I have many levels of parantheses, I space them until I can see at a glance how parentheses pair. I don't have a fixed rule for them, per se.
I use #1. But sometimes you have to watch out or you get something you were not expecting.
ie
What if you are passing around pointers and want to divide with it? (not a 100% example, just a quick demo)
Code:int MyFunct(int *iInt) { int iNew=0,iTwo=2; iNew=iTwo/*iInt;// /* is the same as // (but we all knew that) }
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
I use #1, but should probably use #2 because it is easier to read.
That's how i like to do it.Code:int myFunction(int arg1, int arg2, ... int argN) { int i; for(i = 0; i < arg1; i++) { /* source code */ } return argN; }
adios,
biterman.
Do you know how contemptous they are of you?