What kind of coding styles do you adopt?
edit: DAMMIT my poll is meant to have checkboxes, not radio buttons.
K&R (bracket on same line as if but not for functions)
GNU (crazy indentation style)
Allman (brackets on their own lines)
Whitesmiths (completely retarded do not tick)
Hungarian Notation
Non-Hungarian notation (stupid microsoft).
What kind of coding styles do you adopt?
edit: DAMMIT my poll is meant to have checkboxes, not radio buttons.
Last edited by Brian; 10-19-2003 at 02:51 PM.
I don't really understand your poll. For instance, you could have brackets on their own line and use the hungarian naming convention.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
Hence his comment of:
Which was done a good amount of time before your post.DAMMIT my poll is meant to have checkboxes, not radio buttons
Well, I'm not quite sure what category mine is:
Code:// if / functions / classes / structs / loops: int blah(float one, char two) { //space between ) and {, but on same line, ", " seperating each variable statement; // instead of a space for an indent, I use tabs }
Do not make direct eye contact with me.
Allman all the way
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
i can't really complete it without checkboxes... sometimes i put everything on one line, otherwise brackets get their own line...also, I don't know what some of them mean...Code:int className::retVal(){ return returnedval; } int className::calcVal() { val+=2; return val; }
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
I can't stand brackets having their own line, it looks messy to me
That's weird. Completely opposite to most people. The only reason for having them on the same line is to save space and be able to see more lines at one time. Giving them their own line gives a clearer picture of the code block.Originally posted by glUser3f
I can't stand brackets having their own line, it looks messy to me
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
>Giving them their own line gives a clearer picture of the code block.
Because indention is horrible for that purpose. We should inform Python users before any more damage is done.
The information given in this message is known to work on FreeBSD 4.8 STABLE.
*The above statement is false if I was too lazy to test it.*
Please take note that I am not a technical writer, nor do I care to become one.
If someone finds a mistake, gleaming error or typo, do me a favor...bite me.
Don't assume that I'm ever entirely serious or entirely joking.
Having brackets on their own lines in combo with proper indentation makes it a lot easier to match up brackets.
Now who uses spaces instead of indents? I do...now
uh... I said "clearer", as in better than just indenting.Because indention is horrible for that purpose.
aka: in addition to, as well as, also, with, adjacent to, etc...
It just defines the block more clearly.Code:if(blahblahblah){ //stuff //is second line part of a block? or what? . . .
Last edited by FillYourBrain; 10-20-2003 at 07:48 AM.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
yup. A company I worked for had that in their coding standards so I adopted it.Now who uses spaces instead of indents? I do...now
edit: fortunately visual studios has a setting that makes tab insert spaces instead of tab characters. That has made my life easier.
Last edited by FillYourBrain; 10-20-2003 at 07:51 AM.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
Yay someone else agrees!!!Originally posted by glUser3f
I can't stand brackets having their own line, it looks messy to me
Do not make direct eye contact with me.
Allman non Hungarian. The professionals choice.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
Hmm, I prefer to put empty lines where I need them, not because I just started another loop.Originally posted by FillYourBrain
That's weird. Completely opposite to most people. The only reason for having them on the same line is to save space and be able to see more lines at one time. Giving them their own line gives a clearer picture of the code block.
And matching brackets is just as easy:
This is just my opinion, maybe bacause the fist book I ever read about programming used the coding style, don't know.Code:- for (int i = 0; i < SIZE; i++) { | - if (done) { | | break; | - } - }