|
Pretty Cosmac man!
(I'll fetch my coat).
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Luckily (or unfortunately) I'm the only developer in the Company so I follow my own style. I'm not really strict on style but I do like consistency on naming conventions of objects and variables.
|
|
|
|
|
I am a Nazi, but if it is easy to read and understand, then I am happy.
|
|
|
|
|
So you're a happy Nazi?
This space for rent
|
|
|
|
|
I'm a whitespace-supremacist.
|
|
|
|
|
|
Hah my style is... elastic but reasonably consistent. The amazing thing is that over the years the team of 4-8 developers have been happy to conform to it.
Only thing I won't abide is underscores! Imagine how I feel about Oracle conventions.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Nazi. Totally. And let me tell you why.
To read larger chunks of code with a mixed buffét of styles really hurts my eyes.
Sure I have a style preference. But much much more important is consistency. I am quite happy to submit to an "inferior" style if it is adopted all over the place. I would not like to work at a place without coding guidelines, in fact this is a question I ask at interviews.
... such stuff as dreams are made on
|
|
|
|
|
The only thing what bothers me when I am up to refactoring some other developper's code is when there is no style at all; inconsistency is quite disturbing, but as long as there is some consistency, even if it does not follow my own style, then I'm OK.
You always obtain more by being rather polite and armed than polite only.
|
|
|
|
|
I'm one of those who are strict on style. It just makes it easier if everyone on a project uses the same style. Easier for them to read my code and easier for me to read and maintain other's code.
One of the developers code is almost always untidy, extra whitespace, brackets not aligned, etc. I don't know how he can code or think like that.
|
|
|
|
|
Almost style agnostic, in the sense that there are a few thing that really bug me.
What I absolutely hate:
1) No spaces between operators and operands. Because lines like
kr=k_y+(d_x*(n_srcol-5))+ctxc*rowoff*li;
are evil. And our code is full of lines like that (not an actual line of code but the same way - this is short. There are longer lines like that).
2) Precisely the curly brackets on their own empty line. Just no, it adds clutter. A block starts on the line that defines it, so it starts where there is the "if" not the line later. My stile HAS its disadvantages: it's harder to comment/decomment an entire else branch, and copy/paste entire branches. I can live with that.
3) Mixed conventions for public members. Like some public members starting with uppercase, others with lowercase, or names like read_I and writeO... we have some very integrated (AKA assimilated) code like that and it's a PITA.
What I usually do is to call every global symbol g_something, module symbols m_something, enums are always E_something, structs S_name and types T_something. It helps me with the Intellisense.
EDIT: I work on code written in 16 years by almost 20 different people from different backgrounds. Style consistency is only a dream - luckily I'm infecting my pard with some of my styles...
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
|
|
|
|
|
|
The spacing between * and 'a' is obscene, I usually embed the * in the type, like
int* a = b;
as it is a declaration of "a, pointer to integer".
If I have many similar lines I tend to make them symmetric so to have things like
int a = xx;
longertype longername = yy;
char b = kk;
My colleagues like it and I break this only where it would be senseless (I WON'T make every line extra long and stupidly spaced just for a single
NAMESPACE::LONG_CLASS_NAME::TYPE extralong_name
It just doesn't make sense. Readability first.
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
|
|
|
|
|
Super Lloyd wrote: How many people will consider themselves style agnostic vs style Nazi? Let me propose another question that attempts to enforce a mutually exclusive dichotomy with a semantic double-bind:
"How many of you reading this admit to abusing yourself ?"
As to "style:" how about context ? I mean: my writing code for my own use is one thing, but, if I am part of a programming team creating complex software ? If I want someone reading my qa-reply, or article, here on CP to ... understand it ?
imho, to be conscious of style, to make your style a conscious choice and apply it consistently, to consider context and obligations, and future readers of your code ... this is a good thing that requires neither agnosticism or "sieg heil."
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
|
Super Lloyd wrote: And if I have to refactor their code, I might locally update the style to my preference while I am at it... but that's it.
This is one of my personal pet hates since it's how you end up with a code base that's a cluster-elephant of a dozen different styles.
If you're working in an existing code base match the style of the existing code.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
What do camping and the word intense have in common?
If you're camping, and you're not in cabins, your intense.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
... and some people go camping with evil intent.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
I prefer loitering within tent.
|
|
|
|
|
Only if you build a tentative tent at eve.
You have just been Sharapova'd.
|
|
|
|
|
Did you hear that they built a campground next to the marine wildlife sanctuary? They had to make separate areas, for all in tents and porpoises.
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
I just found out that VS2015 displays the opening statement for a block in a tooltip when you hover over a close brace.
I didn't know that.
No more counting curly braces trying to match them up!
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
VS2008, and I'm assuming earlier versions, has the Ctrl+] feature that matches brackets (curly, round, square, angled).
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
modified 12-Jul-16 13:32pm.
|
|
|
|
|
Didn't know that either.
Either way, this is useful.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
And shift+Ctrl+] to select the whole block (from brace to brace).
|
|
|
|