Comment On Little Black Book

It wasn't that Graham's company lost an employee, it's that they gained a consultant. As an employee, this person excelled at many things, naming functions not the least of these. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Little Black Book

2007-01-09 09:09 • by Henry (unregistered)
adds a whole new dimension to sloppy seconds

Re: Little Black Book

2007-01-09 09:24 • by VAleks (unregistered)
Obfuscation by distraction... A whole new method...

Re: Little Black Book

2007-01-09 09:36 • by SchizoDuckie (unregistered)
People that use function names like this in production code should be shot, killed, shot again and then hung...

function names like checkThatGoDaimnThing() aren't just enough for his frustration??

Re: Little Black Book

2007-01-09 09:37 • by Anonononymous (unregistered)
The head bug is Sally doesn't give any on the first date. So you have to call her again.

Re: Little Black Book

2007-01-09 09:39 • by htg (unregistered)
Must ... kill ... programmer ...

I'm assuming of course that the real code has a lovely descriptive comment block before it saying what it does and thus it is merely amusing rather than retarded.

captcha: 1337

Re: Little Black Book

2007-01-09 09:46 • by Hobson
In my company, in depatament I work, there is like 20+ men hired and almost no woman. I think that adopting this naming convention would make our work maybe not more efficient, but at least more enjoyable.

No quack for 'head bug'.

Cheers,
Hob.

Re: Little Black Book

2007-01-09 09:53 • by deroby (unregistered)
110437 in reply to 110435
LOL, too bad he didn't overload so we'd have 'chromosome' instead of 'int', would have made it the most 'feminine-oriented-code' ever =)

We had a colleague like that too (many, many, many years ago). He preferred things like the 'Hahaah()' and the 'Hihi()' function, still, this tops it, big-time.

Re: Little Black Book

2007-01-09 09:56 • by Stupidumb
OK guys, I'm gonna call Sally at 551-8932.

Any tips on what to say to a girl? I'm a little nervous...I mean, I've seen one before, but I didn't talk to it.

Re: Little Black Book

2007-01-09 09:59 • by Anonymous (unregistered)
110440 in reply to 110434
Best... Comment... Ever!

Captcha: jiggles. I wonder if Sally does?

Re: Little Black Book

2007-01-09 10:01 • by Ken (unregistered)
Remember Jenny defaults to 867-5309

Re: Little Black Book

2007-01-09 10:03 • by McCorvey (unregistered)
110443 in reply to 110436
Hobson:
In my company, in depatament I work, there is like 20+ men hired and almost no woman. I think that adopting this naming convention would make our work maybe not more efficient, but at least more enjoyable.


Another WTF might be the quality of grammar and spelling demonstrated above.


captcha - stfu

Re: Little Black Book

2007-01-09 10:07 • by ptomblin
The first C job I ever had was on a system that had originally been written in FORTRAN, and while it had been re-written rather than ported, much of the "utility" library had been ported. Our convention was that every function in a library had a name that contained a two letter prefix with the library name. When they were using FORTRAN, there was a pesky little limitation on the length of subroutine names, so the ones that had been directly ported all had names like "ut272" while the ones that had been written in C had names like "ut_point_in_polygon". So every now and then a developer (sometimes me, sometimes somebody else) would get annoyed at having to remember what "ut272" meant and would go on a search and destroy changing all the names of a given function, and then trimphantly announcing to the whole company what the new method name was. It was usually greeted by a round of applause except for the 4 or 5 developers left over from when it was in FORTRAN who had grown accustomed to the old names.

I remember the day when I triumphantly removed the last vestige of Fortran from that program - the developers had wanted a VMS stack trace on various error conditions, so they had a "utNNN" function that was written in Fortran that did an intentional division by zero. That seemed stupid to me, and besides, it was in Fortran and I hated Fortran. So I attacked the "Orange Wall" and found sure enough there was a syscall I could make in C that would give me a stack trace without resorting to Fortran. I was so proud.

Re: Little Black Book

2007-01-09 10:10 • by wiregoat (unregistered)
You have to respect that it repeats until Trisha is done. Lucky Trisha.

Re: Little Black Book

2007-01-09 10:18 • by Earl Purple
Totally bad of him to use non-meaningful variable names x and y.

And so, Sally can wait.

Re: Little Black Book

2007-01-09 10:28 • by Fred Flintstone (unregistered)
110447 in reply to 110446
Earl Purple:
Totally bad of him to use non-meaningful variable names x and y.

And so, Sally can wait.


Chromosomes, dude.

Re: Little Black Book

2007-01-09 10:30 • by Rick (unregistered)
I used to work with a guy named Shiv. All his variables, through his code, would be variants of his name: $Shiv1, $Shiv2, $Shiv3, $ShivTest, etc. Made future troubleshooting nearly impossible!

Re: Little Black Book

2007-01-09 10:33 • by Whiskey Tango Foxtrot? Over.
Function name like that are common in code obfuscation contests.

Re: Little Black Book

2007-01-09 10:35 • by david (unregistered)
Heh ... a company I worked for once had a religious publishing division ... and some of their programmers used religious references for goto tags.

Fatal error routing: HELL

Normal end of job routine: HEAVEN

A co-worker told me about a another programmer he knew that LOVED trees ... so all his tags, variables, etc, were named after trees.

Re: Little Black Book

2007-01-09 10:41 • by (unregistered)
110452 in reply to 110438
"I've seen one before, but I didn't talk to it."

You forgot to inflate *her* first?

Re: Little Black Book

2007-01-09 10:44 • by Tigress (unregistered)
One just have to wonder what the function Paula does.

Re: Little Black Book

2007-01-09 10:47 • by DanixDefcon5 (unregistered)
110454 in reply to 110450
david:
Heh ... a company I worked for once had a religious publishing division ... and some of their programmers used religious references for goto tags.

Fatal error routing: HELL

Normal end of job routine: HEAVEN

A co-worker told me about a another programmer he knew that LOVED trees ... so all his tags, variables, etc, were named after trees.


Ahh... Back in the college days, most of my variable naming schemas were made after movies, books or things like that.
Specifically, I remember something like

kwisatz_haderach.add(shai_hulud);

or something like that. One of my friends told me that of course he would be the Kwisatz Haderach after ingesting that much spice!!!

Or calling all my matrix instances "neo", "trinity", "morpheus" ...

Of course, I have since moved on to real descriptive variable names, however some algorithmic code still bears some funny references...

Re: Little Black Book

2007-01-09 10:49 • by Si (unregistered)
He'd better pray to Demeter that Trisha doesn't discover all those calls to his harem while she's busy.

Re: Little Black Book

2007-01-09 10:50 • by Chris (unregistered)
110456 in reply to 110443
McCorvey:
Hobson:
In my company, in depatament I work, there is like 20+ men hired and almost no woman. I think that adopting this naming convention would make our work maybe not more efficient, but at least more enjoyable.


Another WTF might be the quality of grammar and spelling demonstrated above.


captcha - stfu


Well, that's because it's Borat.


Chris Mattern

Re: Little Black Book

2007-01-09 10:51 • by nobody (unregistered)
I think he gave the code VD.

Re: Little Black Book

2007-01-09 11:03 • by Cirdan
110460 in reply to 110446
Earl Purple:
And so, Sally can wait.

She knows it's too late

Re: Little Black Book

2007-01-09 11:11 • by Jim (unregistered)
110461 in reply to 110460
Cirdan:
Earl Purple:
And so, Sally can wait.

She knows it's too late

As we're walking on by

Re: Little Black Book

2007-01-09 11:13 • by ewise (unregistered)

Ouch, this WTF and some of the comments pain me right here...

:: thumps chest ::

Code is complex. We, as programmers, should use every single character to good effect to make understanding our code easier.

This includes whitespace, comments, names, everything! To throw away your names, effectively, by using non-relevant naming schemes, is a CRIME! A crime, I say!

Re: Little Black Book

2007-01-09 11:15 • by me (unregistered)
110463 in reply to 110461
Jim:
Cirdan:
Earl Purple:
And so, Sally can wait.

She knows it's too late

As we're walking on by

Her soul slides away

Re: Little Black Book

2007-01-09 11:19 • by un.sined
110464 in reply to 110441
Ken:
Remember Jenny defaults to 867-5309


Hehe, you beat me to it.

A funny aside to this though... I used to work with a guy who had the number 867-5309. He didn't use that phone anymore, and kept the number around for novelty purposes.

He kept an answering machine attached to it.

Every so often, he'd bring in the recordings from the machine so that we could all have a laugh at the drunken calls that he got.

Re: Little Black Book

2007-01-09 11:27 • by RobertJohnK (unregistered)
110466 in reply to 110454
DanixDefcon5:
Or calling all my matrix instances "neo", "trinity", "morpheus" ...


I once did that for a listener socket instance. It handled most of it's stuff internally but one or two calls on it where necessary from main.cpp so I eventually just named it lisa and didn't care. Eventually there were two of those sockets so the second became bart.

Indeed I usually avoid such nonsense these days.

Captcha: foxtrot. I was rather thinking of Mambo 5.

Re: Little Black Book

2007-01-09 11:29 • by aquanight
110467 in reply to 110453
Tigress:
One just have to wonder what the function Paula does.


Is it not obvious?

return "brillant";

Re: Little Black Book

2007-01-09 11:30 • by Cratig (unregistered)
110468 in reply to 110434
Anonononymous:
The head bug is Sally doesn't give any on the first date. So you have to call her again.



PMSL

captcha: null

mmmm

Re: Little Black Book

2007-01-09 11:54 • by David Green (unregistered)
Someone's been watching too much Scrubs

Re: Little Black Book

2007-01-09 12:03 • by dan s. (unregistered)
110474 in reply to 110433
SchizoDuckie:
People that use function names like this in production code should be shot, killed, shot again and then hung...


I guess all this might stem from him actually being hung

Re: Little Black Book

2007-01-09 12:05 • by Dave (unregistered)
110475 in reply to 110448
Rick:
I used to work with a guy named Shiv. All his variables, through his code, would be variants of his name: $Shiv1, $Shiv2, $Shiv3, $ShivTest, etc. Made future troubleshooting nearly impossible!


I used to work with a guy who would call all his variables a1; a2; a3 etc., then have great globs of code along the lines of:
a1 = a1 + 1;
a2 = a2 + 1;
a3 = a3 + 1;
... etc.

I tried to introduce him to such modern concepts as meaningful names and even arrays, but it was no use!

Re: Little Black Book

2007-01-09 12:06 • by Jim Lang (unregistered)
So, if I wanted to date Sally, I'd have to get past Trish? Or can I call them both?
No, wait, Cassie & Beth look like they're much more fun.
Ah, my wife caught me in a fatal exception.
She used a Shiv.
"goto HELL."
Thank God it's not Cobol

Re: Little Black Book

2007-01-09 12:16 • by danixdefcon5
110477 in reply to 110464
un.sined:
Ken:
Remember Jenny defaults to 867-5309


Hehe, you beat me to it.

A funny aside to this though... I used to work with a guy who had the number 867-5309. He didn't use that phone anymore, and kept the number around for novelty purposes.

He kept an answering machine attached to it.

Every so often, he'd bring in the recordings from the machine so that we could all have a laugh at the drunken calls that he got.


Hmm... I actually have that song somewhere in my old cassette collection ...

Re: Little Black Book

2007-01-09 12:16 • by PC Paul (unregistered)
110478 in reply to 110430
VAleks:
Obfuscation by distraction... A whole new method...


I wish... Have a look at Roedy Green's 'How to write unmaintainable code' essay.

=============
17. Names From Mathematics

Choose variable names that masquerade as mathematical operators, e.g.:

openParen = ( slash + asterix ) / equals;

18. Bedazzling Names

Choose variable names with irrelevant emotional connotation. e.g.:

marypoppins = ( superman + starship ) / god;

============

Captcha: genius

Recognition at last!

Re: Little Black Book

2007-01-09 12:17 • by cconroy
(Hmm, am I missing something or is there no longer any way to quote the original post without manually copy-pasting?)


return TrishaEnd( y );


Check out that end on Trisha... is she wearing a thong?

Re: Little Black Book

2007-01-09 12:21 • by Corporate Cog (unregistered)
Worst wtf in a long time. Malicious intent is lacking in most wtfs.

Re: Little Black Book

2007-01-09 12:25 • by greywar (unregistered)
110481 in reply to 110475
Dave:
Rick:
I used to work with a guy named Shiv. All his variables, through his code, would be variants of his name: $Shiv1, $Shiv2, $Shiv3, $ShivTest, etc. Made future troubleshooting nearly impossible!


I used to work with a guy who would call all his variables a1; a2; a3 etc., then have great globs of code along the lines of:
a1 = a1 + 1;
a2 = a2 + 1;
a3 = a3 + 1;
... etc.

I tried to introduce him to such modern concepts as meaningful names and even arrays, but it was no use!


I'm attending the local college to actually get a degree in what I have been doing for over a decade. The teachers ingrain this behavior. They teach these poor students habits which will harm them long term.

Making a struct called video, then doing this:
video Videos[5];

one character difference. arrgggh. ALL the variable names are a1, a2, etc. 300 lines of code-with one brief comment at the top of the function.

Going to the classes for the credit is painful. I want to pour bleech into my eyes half the time.

Re: Little Black Book

2007-01-09 12:28 • by elbaz
Marginally better then function names like:

X
XX
XXX
XXXX
XXXXX
XXXXXX

Re: Little Black Book

2007-01-09 12:44 • by patric (unregistered)
Reminds me of an application I was working on which had this class to draw a certain kind of diagrams. The class was called ElseDiagram. For the longest time I thought the name of the class meant that the diagrams were not the standard diagrams, instead something else.
It turned out that the programmer who developed the class was named Else, which is a common Norwegian female name.

Re: Little Black Book

2007-01-09 12:51 • by foo (unregistered)
110492 in reply to 110482
elbaz:
Marginally better then function names like:

X
XX
XXX
XXXX
XXXXX
XXXXXX


Even those names are much better than:
OOOOOOOO
OOOOOOO0
OOOOOO0O
OOOOOO00
OOOOO0OO
OOOOO0O0
OOOOO00O
OOOOO000

Re: Little Black Book

2007-01-09 12:55 • by Saladin
110497 in reply to 110481
greywar:
video Videos[5];

That annoys me almost as much as

int myInt;

That's REAL descriptive, thanks.

Re: Little Black Book

2007-01-09 12:55 • by RobertJohnK (unregistered)
110498 in reply to 110482
I also remember code with wonderful variable names (within one iteration) of start, _start, __start, dstart, _dstart, __dstart and several more like those for end. And those were just "days"m obviously minutes, hours and week boundaries were named likewise. Still hurts my eyes.

Re: Little Black Book

2007-01-09 12:55 • by ssprencel
110499 in reply to 110447
Fred Flintstone:
Earl Purple:
Totally bad of him to use non-meaningful variable names x and y.

And so, Sally can wait.


Chromosomes, dude.

If Sally has an X and Y chromosome, then I don't want any! (That's not relly Sally, it's Sammy)

Re: Little Black Book

2007-01-09 12:57 • by dolo54 (unregistered)
Well I generally try to make my names meaningful, however occasionally I do throw in the odd joke here and there. For instance I have something called a wordTextField... in my code this is abbreviated to "wTF" of course!

Re: Little Black Book

2007-01-09 13:10 • by KattMan (unregistered)
110507 in reply to 110497
Saladin:
greywar:
video Videos[5];

That annoys me almost as much as

int myInt;

That's REAL descriptive, thanks.

I honestly do not see the problem with the video Videos[5] as it shows you that a video is a single instance but the plural is a collection or list of some sort. I agree it would be helpful to know which of these types of objects it was, but still it is descriptive without being verbose.

As for the int myInt;
That is a problem only if this int should be for something particular. If it is used later as simply a counter for iteration then I see no reason why you need a better name, of course int myCounter; might have been a better choice.

Re: Little Black Book

2007-01-09 13:18 • by Saladin
110513 in reply to 110507
KattMan:
As for the int myInt;
That is a problem only if this int should be for something particular. If it is used later as simply a counter for iteration then I see no reason why you need a better name, of course int myCounter; might have been a better choice.

I agree with that, my main beef is how so many instructors teach that as the "fallback" name to give anything if you don't know what to name it. Surely /something/ that at least gives some sort of insight into its purpose would be better than "myInt," if only to help readability and make things easier for a new reader to figure out. I mean, why "my" anything? If you're going for simple counters, just use "index" or "i" or something, not "myIndex" or whatever. You're the programmer, of COURSE it's "yours."
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment