|
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).
|
|
|
|
|
FWIW, that feature's been around since Visual C++ 6.0 at least.
Software Zen: delete this;
|
|
|
|
|
What is the opposite of a Pokemon?
A Peekmon.
(Yes I know how it is really pronounced)
|
|
|
|
|
We have been calling administrators 'Admons' for years. Came from a typo, but the similarity to Pokemon was the final nail in the coffin.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
... But am I alone in thinking that the guy who plays Walker is a CGI character drawn by by Carlos Ezquerra?
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Carlos Ezquerra, the guy who drew Judge Dredd? I have to have a look on the 5 catch up site...
|
|
|
|
|
glennPattonInThePUB wrote: Carlos Ezquerra, the guy who drew Judge Dredd? Dredd, Strontium Dog, and many others.
Faces unshaven, lipless, and with a particularly-shaped scowling mouth are almost a trademark of his. The (South African, although that's probably not relevant) actor could have walked out of one of his pages.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
I posted a message on the QlikView "community" forum:
SUBJECT: Job Openings
BODY: Please tell me you guys are hiring developers to fix QlikView.
I wonder if they'll terminate my account.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Stupid.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Yes.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|