Comment On Useless Functions, Extreme Naming, and More

"We had a programmer in our company whose specialty was to write functions that embodied his own personal traits," Winston Muller, writes "do absolutely nothing and mislead everyone to think that something was done." [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Useless Functions, Extreme Naming, and More

2011-11-01 08:28 • by Nix Nada (unregistered)
I tried to learn to speak Gay but I couldn't get my tongue around the hard bits.

Re: Useless Functions, Extreme Naming, and More

2011-11-01 08:58 • by PedanticCurmudgeon
365202 in reply to 365183
HoHum:
Assuming you're not a troll (and it is getting hard for me to tell...
Look, it's quite simple:

1. Is the post a heated response to a post that is either ill-informed or just plain stupid? If so, they have been trolled.

2. Is the post lofty pontification about something nobody really cares about? If so, it may be annoying, but not a troll.

3. If the post doesn't fall under either of the above categories, it's a troll.

Re: Useless Functions, Extreme Naming, and More

2011-11-01 10:49 • by milleniumbug (unregistered)
365230 in reply to 365109
Steve The Cynic:
milleniumbug:
#define TASK_RATE (5) //Task rate in milliseconds

WTF? Comments in define!

Nothing wrong with comments in a #define.

However, in the real world, "rates" are measured in Hz, not seconds. It should be TASK_INTERVAL or TASK_PERIOD or something like that.

Well, assuming it really is in milliseconds, that is, and not work-units per unit of time.


Yeah, I just realized that the comments are left alone by the preprocessor - good to know.

Re: Useless Functions, Extreme Naming, and More

2011-11-01 11:09 • by TheSHEEEP
http://code.google.com/p/ofxtools/source/browse/trunk/OfxCommon/simpleOFX.cs?r=7

A quick google for one of the long strings came up with that o.o

Re: Useless Functions, Extreme Naming, and More

2011-11-01 11:46 • by QJo
365255 in reply to 365235
TheSHEEEP:
http://code.google.com/p/ofxtools/source/browse/trunk/OfxCommon/simpleOFX.cs?r=7

A quick google for one of the long strings came up with that o.o


Goodness so it was:

// This code was generated by a tool.


The comment must have been put in place by the maintainer, who clearly has issues with the programming style of his predecessor.

Re: Useless Functions, Extreme Naming, and More

2011-11-01 15:51 • by Matt Westwood
365342 in reply to 365189
HP PhaserJet:
Tell me, this, Westwood: just how, accepting, of Eddie Murphy are the, British? I'm really, really, curious to? know?

But, could I ever get, an honest answer?

Did you, or did you not, enjoy the family, farting scene from, The Nutty Professor?

Are you a racist?! Does your hatred, for Asians, run so deep, that you would, cast such blatant, !ludicrous!? "No" you say, but can you be honest, even with yourself?

Have you ever been?
Honest?
With, yourself?

Maybe you're just, afraid to be?


Eddie Murphy? Bag of shite.

Nutty Professor: I have managed to avoid having seen it, and I'm going to make sure it stays that way. There is only one fart joke in movies worth a fuck and that's in Blazing Saddles.

And when did I ever express hatred for Asians?

Now don't do drugs and WTF at the same time again, or you'll make yourself look even more fucking stupid than you already have.

Re: Useless Functions, Extreme Naming, and More

2011-11-01 18:33 • by Kuron (unregistered)
After reading the comment, maybe he wanted the Logoff to be a success, and made it return true ;)

Re: Useless Functions, Extreme Naming, and More

2011-11-01 19:01 • by Dirk (unregistered)
"Error in ManageRelations method of Biz Rules media of HE"
Great! Because you never can trust the stack trace.

Re: Useless Functions, Extreme Naming, and More

2011-11-01 19:22 • by Fag (unregistered)
I can't believe we haven't set off an anti-homophobic rant. I'm impressed guys!

Re: Useless Functions, Extreme Naming, and More

2011-11-01 19:25 • by yername (unregistered)
365383 in reply to 365197
Triscopic:
yername:

I heard Visual C++ 4 used to drop entire blocks of code.
Must have been fun debugging that.


For a while Qt's IDE would randomly delete collapsed blocks of code when files were saved. That was tonnes of fun.

Just to clarify: I meant the compiler and not the IDE.

Re: Useless Functions, Extreme Naming, and More

2011-11-01 23:51 • by Chris (unregistered)
365392 in reply to 365071
Matt Westwood:

writtenComment() {
return true;
}


it's not really a WTF. If the codebase makes use of callbacks / anonymous functions, then it is perfectly valid to have functions simply return true.

And it's also not new. The same "WTF" gets posted on a regular basis.

Re: Useless Functions, Extreme Naming, and More

2011-11-02 06:16 • by bobthecoder (unregistered)
I once admonished a programmer for using an exceptionally short and meaningless method name. He never took this criticism well and blatantly had an attitude problem because the next thing I saw was something like:

method get_user_id_and_load_user_and_check_date_and_if_old_perform_action(integer id_of_user);

Re: Useless Functions, Extreme Naming, and More

2011-11-02 06:58 • by QJo
365402 in reply to 365401
bobthecoder:
I once admonished a programmer for using an exceptionally short and meaningless method name. He never took this criticism well and blatantly had an attitude problem because the next thing I saw was something like:

method get_user_id_and_load_user_and_check_date_and_if_old_perform_action(integer id_of_user);


Don't tell me: you had a fist-fight with him in the office, where it spilled out into the corridor and into the car park?

Re: Useless Functions, Extreme Naming, and More

2011-11-02 08:30 • by no laughing matter
365408 in reply to 365401
bobthecoder:
method get_user_id_and_load_user_and_check_date_and_if_old_perform_action(integer id_of_user);


Loads of TRWTF:
* Method Parameter is specified as integer, but no return type of method given: A WTF-hybrid of a statically and dynamically typed language?
* First part of described action: get_user_id. Parameter specified: id_of_user!
* Much too much actions for a single method. One Method, one responsibility!
* load_user? I sense a FILE_NOT_FOUND here.
* check_date? Which date? This risks to turn into a meme!
* check_date_and_if_old_perform_action: BANG! Were in Zunesis-land now!

At least bobthecoder does not claim that i am his son.

He also is not my uncle and this is no laughing matter!

Re: Useless Functions, Extreme Naming, and More

2011-11-05 13:56 • by method1
365823 in reply to 365119
Steve The Pirate:
That is an interesting value to initialize your int to

Now why don't compilers have sarcastic error messages like this. It could be a compiler switch.

Re: Useless Functions, Extreme Naming, and More

2011-11-08 05:13 • by C (unregistered)
365961 in reply to 365119
Steve The Pirate:
C-Octothorpe:
That last one is eerily similar to the code-base I inherited about a year ago, except replace all the "safe" if blocks with try/catch blocks...
public static int StringToInt32(string str)

{
try {
return int.parse(str);
}
catch { return 0; }
}
Ahh, now that's a beaute! Or the single return variant:
public static int StringToInt32(string str)

{
int returnValue = "";

try {
returnValue = int.parse(str);
}
catch { }

return returnValue;
}
Now if this "pattern" doesn't scream "I don't give a shit about the quality of my code", then I don't know what does...

That is an interesting value to initialize your int to
Don't you mean "initialize your itn" instead?! RTFC!

Re: Useless Functions, Extreme Naming, and More

2011-11-08 15:01 • by Tero Tilus (unregistered)
Who ever came up with the naming conventions used in OFX schema deserves a bare bottom spanking.

lol

2011-11-13 22:25 • by wow (unregistered)
That last one really got me.

Re: Useless Functions, Extreme Naming, and More

2013-06-13 15:53 • by anonymous (unregistered)
public override EngineBlockCasting Inspect(Casting)

{
if (Casting.IsGood) {
try
{
return Casting;
}
catch (Exception BrokenConveyer)
{
throw Casting;
}
}
}

Bonus points if anybody can make it calculate the ballistics on a PostScript printer.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment