|
I go for as short as possible without doing myself or anyone else a disservice in terms of retaining the intent of a variable or function name. As early as yesterday I have to break down and get wordy with a function name because there seemed no other way. It kinda felt dirty but it is what it is. RestoreFocusAndSelect()
O and I never abbreviate. I've looked at old code of mine and saw oh, ctrlbindrv and thought how coy.
|
|
|
|
|
Managers aren't allowed to look at my code. The team lead and other devs can of course, but if you try to micromanage me, you may as well expect my resignation EOB.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Yeah! Way to go!
|
|
|
|
|
I learned early on in this business that it pays to be hard nosed about certain things, both for my own sanity, and the good of who I work for.
I also learned to get out early when things looked like they would set me up for failure.
When I interview for a position, I'm the one do the interviewing, because I'm very selective about what kind of shop I'll work for.
I learned that not only can I afford to do this, I can't afford not to, because honestly? There are more bad dev shops out there than good ones, and I have a reputation and my own personal standards to live up to. I will not work for a shop that drags me down due to bad practices and/or bad management.
To err is human. Fortune favors the monsters.
|
|
|
|
|
I am used to far more abstract ways to access data, like directly using hexadecimal memory addresses. That makes me very unobsessed with naming in general. And there are far too many masters of the obvious who name things after, well, obvious or easy to find out things instead of using the variable name to hint at the intention behind a variable.
Anyway, I usually prefer the shorter version. Calling a variable 'ConnectionString' is more than enough. 'ZeroTerminatedArrayOfCharactersWithConnectionInformationForTheApplicationButNotForTheSeparateDatabaseWithUserInformation' might be a little too unwieldy, especially when everything is named like this. And I have seen people go overboard like that. Even with two monitors you can't even read a short line without scrolling.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Variable/Method names should be
descriptive enough to know what it should be
Distinguishable enough from other variables
clear and easy to use
So I'd prefer short names, but if a long name is more appropriate, just do it.
also:
They always taught me : if it's not broken, don't fix it.
Making changes for the sake of changes is never a good idea and I can't imagine a style guideline: "your names should be at least 15 characters long"
|
|
|
|
|
With exception of loops (and other places like x,y,z where there are conventions) I use descriptive names. I find it easier to maintain long term. "But who cares, the code is done" sounds very strange to me - but then I only work on products that goes on for many years (decades) so it's our own foot we are shooting. I have indeed seen a (understandable) change in attitude from people working on single projects where it is just about what is delivered now, not what you can maintain next year.
If a variable ends up with a long name, it means it is hard to explain what it is doing... which is exactly the case where you need the long name.
|
|
|
|
|
|
kmoorevs wrote: As an aside, do you name your UI controls intelligently, or is Textbox1, Textbox2 good enough?
Doing WPF UI this question is not very relevant..
If I were to give a name to UI Element, as it occasionally happen, it usually a short descriptive one
|
|
|
|
|
|
The Lounge[^]
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Another ship sank? Or did they try to raise the last one and then it sank again?
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
I can't quite bring myself to feel terribly sorry for anyone who can afford any of these cars.
Especially when, y'know, you don't pay in advance when buying a new car.
|
|
|
|
|
Years ago I spent quite some time in the little town of Ashby de la Zouch in central England doing a technology transfer from the Transmitton company. I also spent a day or two in London, where I was introduced to "a pint of bitter". I was so impressed with the beer that I made a special trip to the Bass brewery. In Ashby I lived on fish and chips English style, where the chips are nothing at all like American crisps or chips. English chips are fried at a lower temperature, so they remain soft and not crispy. When you buy the dish for take-out, it is typically handed to you in a large white paper cone, seasoned with salt and vinegar, never ketchup, with fried white fish like cod. Yum!
Lately I have developed a craving for this style fish and chips - and I find myself wishing I had a good reason to visit the UK so I can once again taste a few pints of bitter and proper fish and chips. Rats! Now my mouth is drooling!
Get me coffee and no one gets hurt!
modified 1-Mar-22 16:06pm.
|
|
|
|
|
I'm not a fan of "chip shop" chips - "soggy bags of pus" to me - I prefer triple-cooked chips, which are glass-like on the outside and fluffy on the inside. Lot of work for a side dish though!
But "Proper fish" - beer battered Cod, crispy and fresh - that's a good one! Making me hungry now as well ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I spent ten days in Leeds a few years ago at a customer site. My favorite foods were fish and chips, and the maple cake dessert at the pub across the street from my hotel.
Software Zen: delete this;
|
|
|
|
|
A couple decades ago I spent a couple weeks in Redcar at the old British Steel works. Redcar billed itself as the fish and chips capitol of the UK.
Not sure it was true but they were damn good!
|
|
|
|
|
Hi, before the turn of the century you got the stuff wrapped in newspapers, I still remember the stains from the newspaper print on my finger tips.
|
|
|
|
|
Years ago, Norwegian newspapers reported about a record-breaking English lottery prize, won by a poor guy who until then had been operating his pavement wagon selling fish and ships.
|
|
|
|
|
I detest beer but I love cider, and in the UK it's plentiful and common - in my country most people don't even know what it is.
And now I want to get back to an english pub with a pie and a pint of cider.
GCS d--(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--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Just watch out for Johnny Jump Up.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing 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
|
|
|
|
|
A pork pie, a slab of Lancashire cheese, some Branston Pickle and a large glass of cider - aah! The good old days back in Blighty.
Pub lunches were unbeatable.
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
Good news! There is one less hunter running around in the woods. He ended up in my frying pan[^]. He now is resting (and cooling down) in the gravy.
Pure torture! I'm hungry!
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Yummy. I remember them from my time in Germany!
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
Yet when a vegan posts about their vegan meal, everyone is like "How do you recognize a vegan? Don't worry they'll tell you!"
|
|
|
|