|
|
I'm weird. for me it depends on the language, because I let my style be dictated by the larger community choice. I suppose that means I'm either indecisive, or I don't really care one way or the other.
C/C++/C# - Style 1, and I can't abide code written in style 2.
Javascript - Style 2. To the point that if I see javascript written in Style 1, I don't even recognize it as valid javascript.
Java? By the time I've reached my first curly, I've already written too much Java, so I just delete the project and start over in a better language.
|
|
|
|
|
Interesting, since I don't recognize javascript as a valid language.
(My "favorite" part about Python: scratching your head why something is failing only to realize that one line is indented using spaces and the next tabs.)
|
|
|
|
|
|
Dan Neely wrote: The javascript engine's semicolon injector behaves in ways that make it clear it doesn't regard opening braces on the next line as valid js either.
Yeah, I really wish there was a way to turn off ASI in my js files (like a 'use strict' kind of thing).
|
|
|
|
|
I think on the one of the Microsoft Guide lines for Capitalisation they call it PascalCasing instead of CamelCasing and then use camelCase also.
|
|
|
|
|
Yes you are an old fart, who cares what other people source looks like...
Using a decent editor (even the Visual Studio editor does this):
just go to the last close curly
delete it, then put it back
(or just highlight it and type close curly)
the code gets reformatted to your default style set in your editor.
a lot simpler then posting messages complaining and insisting 'your way is better for everybody'
I can tell you, without even seeing it: your way is crap, that is it's crap to everybody except yourself, just as mine is crap for anybody but me. And yes, your company guidelines are crap too, to anyone except the pillock who created the 'guidelines'; AKA 'somebody with way too much free time' - and you should tell him that - do some bloody real/proper work instead of wasting time making other peoples lives miserable.
Help make the world a better place: Stop bitching about other peoples ways, particularly when there's simple tools that in seconds let you 'fix it' and carry on your own way - these things matter not at all.
And for sure, one day, when you get promoted: just DON'T become that jerk-off that creates "company coding standards" and other such nonsense; leave it, get a life, and let other people have theirs too.
|
|
|
|
|
ffs, all I did was solicit opinions....
Robert, please take your meds and go to your quiet place...
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
To be sure, I can't read Melody's style at all.
I associate that code style with idiots who just keep jamming random code in until something happens ...
|
|
|
|
|
I like #1 but actually use #2 in practice.
{To-do: fill section with wit}
|
|
|
|
|
For me K&R. CamelCase when public members, camelCase when private.
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
|
|
|
|
|
BEFORE - for C# style and NOW - Java.
|
|
|
|
|
Well - when it comes right down to it,
struct doneRight Melody_Crawford_Cleaned_Up_Their_Mess() {
"Their indents sucked";
}
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
My 2¢: I was a devotee of K&R braces (the second style) for a long time. When I started programming in C#, I switched to Allman[^] braces (the first style).
I've grown to prefer Allman to an extent such that I've written a VS editor macro to reformat K&R braces to Allman. I don't use the built-in VS reformatting; they screw up too many other things.
Software Zen: delete this;
|
|
|
|
|
The boss should be thanking Melody for fixing his brackets. I hope she replaced his spaces with tabs, while she was in there.
If you think 'goto' is evil, try writing an Assembly program without JMP.
|
|
|
|
|
One of the good things about Visual Studio is that if one of my colleagues have been making changes to the product I am responsible for, and ignored the bracing / indentation rules, I just delete and reinsert the final closing brace of the file, and everyting is back to the 'proper' style. Oh well, the end-of-line-comments may not be properly lined up, in the parts that were changed, but that's not a terribly big problem (besides, most programmers use end-of-line comments very sparingly).
("My" product is a C# thing. I have noticed that VS is not as good with C++ as it is with C#, and I don't know if this works the same way in C++.)
|
|
|
|
|
Or just type CTRL+K then D - it'll reformat it without an edit being needed.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I liked this one! And I didn't think it was that difficult...
Get out key is sorry (10) ESCAPOLOGY
Anyone want to explain?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Get out Key = ESC (Escape Key)
Sorry = Apology
But what is Escapology ????
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
Get out
key ESC
is sorry APOLOGY ESCAPOLOGY[^] - the Art of Getting Out of Things!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: ESCAPOLOGY[^] - the Art of Getting Out of Things!
If it ends in "-ology" it must be a science
|
|
|
|
|
|
|
Anurag Gandhi wrote: Please visit the official website and Twitter for more detail. No. I much prefer gathering information from uninformed sources; it's so much more fun.
This space for rent
|
|
|
|
|
I've been using text-based MSDN for years now. If I want to look up an API call, I text the name of the function to a number, and they reply with a text showing the syntax. Very handy, very quick and easy to use. Love it!
|
|
|
|