Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in Programming. |
User | Post |
Rydain Posts: 185/633 |
West Coast. For some reason, I got into a habit of using it, and I don't see the point in switching because I honestly think that both styles are equally clear. I tend to see the beginning of loop statement or function declaration as the start of a bracketed block of code, so I'm already used to looking for that instead of looking for the opening brace itself.
And though I agree that highly compressed code sucks (people at work do this all the time and it drives me batshit to read it), I hardly think that putting a single brace on the same line as a conditional or function declaration is anywhere near as unreadable as squishing an entire block of code into a single line. |
Kyoufu Kawa Posts: 456/1353 |
Originally posted by ||bassYou too eh? |
Disch Posts: 37/202 |
Agreed
Compact code also works well in other areas (like moderately large macros) |
||bass Posts: 103/594 |
I'd also like to point out that, although I use East Coast style, West is appropriate if not preferable in cases of 1 line functions.
Take the example: int getSize() {return(_size);} Stuff like this would look silly expanded out. |
Disch Posts: 35/202 |
Compressed code is ugly, hard to follow, and just all around sloppy. Honestly, what is the point of shaving 1 line off your code if it makes the code harder to read? Putting a comment here and there, or even just an empty line or two to seperate blocks of code may make the source file a whole 2k bigger (as if that's some kind of big deal or something) but it makes things more of a hassle to work with. Back in the day I took this a step further doing things like:
because I thought "having a line with just { or } on it is wasteful". Of course if you can imageine how cluttered and hard to follow my code was... you'll see why I eventually switched. So yeah -- "east coast" I guess. Although where do these names come from? Wouldn't the { on its own line be west coast since the { is more to the left? or do the names have some other meaning? I've never heard these terms before this thread. |
Randy53215 Posts: 85/726 |
I tend to use both say...
But I will go with east coast, because I tend to use that more. |
Black Lord + Posts: 66/273 |
Wow lots of mixed opinions... the reason why I was asking was because my C++ 2 teacher demands we use east coast... he says it was the only way. I have always used east coast, but I just thought I'd ask you all what you thought... I wasn't expecting such a close poll at all. |
FreeDOS + Posts: 203/1312 |
West looks better to me. |
MisterJones Posts: 22/125 |
East Coast. 'cuz I like it and works better with Crimson Editor's select block and Code::Blocks hide code feature. |
Gavin Posts: 105/181 |
I would easily say East coast. For a time I blundered around with West Coast style, but then I saw the light. East coast just seems to provide a better visual orientation... keeping the brackets on the same indentation level just makes more sense spacially and logically. |
Boom.dk Posts: 60/356 |
West Coast for me. It seems stupid to use 2 lines for such a statement. I dunno. |
firemaker Posts: 117/194 |
East coast all the way. West coast is fairly annoying to read for sure. |
creaothceann Posts: 14/43 |
I've learned coding in DOS editors (25 lines max.), so "West Coast" all the way. Can't stand stuff like
If x then Though that's only in Pascal. In C I'd probably use "East Coast". |
interdpth Posts: 29/362 |
I'll take either depends on how long the source file I am working with is. If it's a few lines i'll take west coast
Otherwise east coast |
Kyoufu Kawa Posts: 432/1353 |
East coast, because the braces and the invisible tab-lines connecting them stand out more.
I keep reformatting -.- |
HyperHacker Posts: 901/5072 |
East is just so much easier to read. |
Zem Posts: 531/1097 |
Huh.
West Coast, for no more interesting reason than that's the way I learned it and that looks better to me. |
neotransotaku Posts: 535/1860 |
East Coast -- i can't stand braces on the same line with an if, for, while, etc; readability is the main reason. Also, in the old days, that was prefered because space was a premium. However, with RAM averaging 1GiB, and HD setups that approach 1 TiB, who needs to save space? |
||bass Posts: 97/594 |
Definately East Coast for me.
I notice alot of older programmers (read: over 40) seem to prefer the West Coast style. I strongly dislike the West Coast style because the code looks far less organized. The physical layout of code with the West Coast style is almost reminiscent of VB, a language I intensely dislike. You'll also notice with East Coast style that you can immediately tell which opening brace goes with which closing brace with no effort at all. Readibility all the way. |
Xkeeper Posts: 1036/5653 |
I always found that the 'west coast' style with proper indentation looked better...
conditional statement { verusus conditoional statement *Xkeeper shrugs |
This is a long thread. Click here to view it. |