Comment On Comments from a Madman

It's hard to maintain your cool while writing software, and therefore hard to not have that reflected in comments. It's probably a good idea to get in the habit of searching the codebase and replacing four letter words prior to checkin. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Comments from a Madman

2007-06-22 09:06 • by Harry (unregistered)
Brilliant!

Re: Comments from a Madman

2007-06-22 09:09 • by Chris (unregistered)
The part of this which I find is the most WTF is this:

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "All")
{
Jack.BoyType = BoyTypes.Dull;
}

Shouldn't that be

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "No")
{
Jack.BoyType = BoyTypes.Dull;
}

lol, all work and all play makes jack a dull boy
(whoops, fixed it - ed.)

Re: Comments from a Madman

2007-06-22 09:11 • by guy (unregistered)
142175 in reply to 142173
Chris:
The part of this which I find is the most WTF is this:

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "All")
{
Jack.BoyType = BoyTypes.Dull;
}

Shouldn't that be

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "No")
{
Jack.BoyType = BoyTypes.Dull;
}

lol, all work and all play makes jack a dull boy

No,

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "FILE_NOT_FOUND")

Re: Comments from a Madman

2007-06-22 09:14 • by Telimaktar (unregistered)
// just need get the &#$*ing class name of a string array
String[] blah = new String[1];

Lol, how I'd love to put that in my comments. Give the next victim a laugh.

Re: Comments from a Madman

2007-06-22 09:17 • by vt_mruhlin
//if we're not getting the database, just return some random numbers instead


I hope this guy's writing ATM software.

Re: Comments from a Madman

2007-06-22 09:18 • by undefined
142180 in reply to 142173
No, it should be change from/to:

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "All")
{
Jack.BoyType = BoyTypes.Dull;
}

if( Jack.WorkQuantity == "All" && !Jack.PlayQuantity == "All"){
Jack.BoyType = BoyTypes.Dull;
}



Re: Comments from a Madman

2007-06-22 09:21 • by Wildpeaks (unregistered)

// this check in abstract should not be needed,
// but abstract is often too abstrat for me to postive about

Love it :-)


Captcha: sanitarium, yep that's the current location of this submission's author

Re: Comments from a Madman

2007-06-22 09:28 • by W.B. McNamara (unregistered)
I think I've pointed to it before, but a year or so ago I came across a file of the most interesting comments I'd encountered while "maintaining" a large web-based app.

From the post:

Then we have the ever-popular “oops” comments. These are particularly enjoyable, as they invariably exist independent of any more detailed examination of the issue (or any indication of whether it was resolved):

;;; what the fuck is this crap? looks like I left a sponge in the patient.

Re: Comments from a Madman

2007-06-22 09:30 • by AbbydonKrafts
Now THIS is a good WTF front post. I love it! xD

Re: Comments from a Madman

2007-06-22 09:30 • by Michael (unregistered)
142185 in reply to 142180
undefined:
No, it should be change from/to:

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "All")
{
Jack.BoyType = BoyTypes.Dull;
}

if( Jack.WorkQuantity == "All" && !Jack.PlayQuantity == "All"){
Jack.BoyType = BoyTypes.Dull;
}

The line is "All work and no play makes Jack a dull boy", so if Jack.PlayQuantity = "Some", then your logic would still make Jack a dull boy.

Alternatively, you could have:

if (Homer.TVQuantity == "None" && Homer.BeerQuantity == "None) {
Homer.action("Something Something");// Go crazy?
}

Re: Comments from a Madman

2007-06-22 09:31 • by strictnein
I love this one:
// I don't get this why substracting 1 from the month is giving
// 1 YEAR ago. Would appear bad, so watch this
gc.add(Calendar.YEAR, -1);


Yeah, I wonder why that is happening!

Re: Comments from a Madman

2007-06-22 09:32 • by MoroS (unregistered)

...
F**K <- Who wrote that???
...


This is my favourite. xD

Captcha: wigwam... hough chief...

Re: Comments from a Madman

2007-06-22 09:34 • by DOA (unregistered)
"catch(Exception ex) {
System.out.println("CAN'T DO S**T");
};"

Now all we have to do is wait till this shows up on a giant screen somewhere

Re: Comments from a Madman

2007-06-22 09:36 • by Coditor
My personal favorite:

// not sure why this needs to be a HashMap - and I wrote the damn thing

Re: Comments from a Madman

2007-06-22 09:41 • by jimjim (unregistered)
I loved that one


//This is a miserable hack I am about to perform.

Re: Comments from a Madman

2007-06-22 09:44 • by Nick (unregistered)
I once added the following comment to some code I wrote...

// If you can understand this code... then I congratulate you. See me for a cookie.

I'm not going to publish the code, as it wouldn't make sense out of context... but let's just say I had Hashtables containing Hashtables containing ArrayLists. I'm not saying it was the smartest idea, but it worked.

Re: Comments from a Madman

2007-06-22 09:50 • by BlueKnot (unregistered)
// don't ask.... okay you wanna know.

Ok... now he's talking to himself, hearing an imagined response, and answering back...

(P.S. In this case, the captcha is eerily appropriate: "alarm"!)

Re: Comments from a Madman

2007-06-22 09:54 • by Carrie (unregistered)
Gee, the best comment I've ever seen was probably "Keep on truckin'..." on a loop. I feel deprived. This probably isn't a bad thing in this case.

Re: Comments from a Madman

2007-06-22 09:55 • by jimlangrunner
AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!

Funny thing is, I can almost hear myself thinking those same things. A good night's sleep and a diff before check-in almost always fixes that. And NOT having the 6-pack at lunch

Re: Comments from a Madman

2007-06-22 10:02 • by mkb
142200 in reply to 142173
Chris:
The part of this which I find is the most WTF is this:

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "All")
{
Jack.BoyType = BoyTypes.Dull;
}

Shouldn't that be

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "No")
{
Jack.BoyType = BoyTypes.Dull;
}

lol, all work and all play makes jack a dull boy
(whoops, fixed it - ed.)


This is Java, so you should probably be doing if (Jack.WorkQuantity.equals("All") && Jack.PlayQuantity.equals("No"))

Come on, the author of the daily horrible code sample should know better by now!

Re: Comments from a Madman

2007-06-22 10:04 • by easyon (unregistered)
// sometimes its best to be quiet

CAPTCHA: bling
Be quiet and just bling bling.

Re: Comments from a Madman

2007-06-22 10:09 • by bstorer
142203 in reply to 142200
Or at least if (Jack.WorkQuantity.intern() == "All".intern() && Jack.PlayQuantity.intern() == "No".intern())

Plus, the Java conventions would have those be metods called getWorkQuantity and getPlayQuantity. "Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized."

Re: Comments from a Madman

2007-06-22 10:10 • by Zylon
Q: How do you know when DailyWorseThanFuck has really, finally, truly jumped the shark?
A: When anime emoticons start showing up in the comments.

Re: Comments from a Madman

2007-06-22 10:13 • by dan (unregistered)
I hope this guy writes code for that Vegas balloon billboard you guys put on wtf yesterday!

dan

Re: Comments from a Madman

2007-06-22 10:13 • by SchizoDuckie (unregistered)
Something tells me this guy should indeed just go flippin' hamburgers 'cause he just writes *damn* shitty code that he doesn't even understand himself.

LOL @ vt_mruhlin's ATM comment b.t.w. :D

Re: Comments from a Madman

2007-06-22 10:24 • by /b/ (unregistered)
catch(Exception e) {};// sometimes its best to be quiet

this is where my 100 points go

Re: Comments from a Madman

2007-06-22 10:28 • by chornbe (unregistered)
Man, do I feel this guy's pain. Oh my, oh my, oh my.

This prompted me to go look at a few older projects that I remember having some interesting things in them. Found a gem or two:

'// this is a hokey and kludgy module I came up with to encapsulate the logging in the CMLService app.
'// I'm not real proud of the mechanics, but the end result is nice. If you need to mess with it, please
'// remember to take your medication first. I'm not responsible for your mental state when you're done.
'// It has a dependencie on the CLogger class (Pronounced See-Logger, not Clogger - this ain't RotoRooter!)




'// Real simple. Either the file's there, or it ain't!
'// as with other modules, this is elementary API code. If you don't follow along, close the file
'// and don't mess with it. Just call it from elsewhere, since it's a global (LocateFile())
'// These api calls are simple and easy to use, but changing the delcaration(s)
'// can not only break them, but can cause GPFs and all sorts of nasty and hairy things on the system.



'// DELPIAN Globals... Yeah, I know... Back off man.


'// set a global reference (global within this project) to the current Service Object
'// so that other parts of the app have easy access to it. Yeah Yeah! Global. I know.
'// Back off!


'// this function spits back a CRLF delimited list of files found in the supplied folder
'// that match the supplied filespec (Spec variable). The function returns plain text so that
'// it can be run from nearly anywhere, via DCOM, locally, whatever. This way, no type conversion
'// or marshalling issues arise.
'// The code here is elementary level API calls, and if you don't follow along, please close this file
'// now and stay out of my code... ie... DO NOT Check this file out for any reason!


'// Does this module really need any comments?
'// ok, fine. This module contains some, hopefully most, definitely not all, of the global const's used
'// thru' the project.



'// This sub gen's up a BRAlert object (DCOM server) and uses it to dispatch alerts
'// most of the code is self-explanitory, noting that instead of using "NEW", it's using "CREATEOBJECT"
'// to create the server object. This is because NEW can not create remote DCOM servers.
'// A long long time ago, in a galaxy far away, I set up the original BRPHL-SWEEP01 server as a BRAlert server
'// and have continued to use it as the production alert dispatcher!



'// This code is ripped from MSDN then slightly modified for my purposes. Ego-centric programmers
'// ALWAYS "improve" stolen code to make it "better".
'// Like some other modules, if you really want to change this, make sure you're medicated first.
'// It's very specific... it validates, and logs in if necessary, to a network share. It works, so
'// I wouldn't mess with it if I were you. If you do, be sure to add your name to the list of those
'// who modified it :) Like this:



Re: Comments from a Madman

2007-06-22 10:30 • by Theo (unregistered)
Absolutely frigging brilliant.
Sometimes I wish I had such comments when reviewing crappy code. That would at least be less boring.

Re: Comments from a Madman

2007-06-22 10:32 • by Bob Saget (unregistered)
Looks like he's writing a tomcat application. In which case I can sympathize, that stuff is brutal to work with.

Re: Comments from a Madman

2007-06-22 10:36 • by marlow4 (unregistered)

/*¤***********************************************************
* *
* .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-. *
* | ______ | *
* | .-" "-. | *
* | / \ | *
* | _ | | _ | *
* | ( \ |, .-. .-. ,| / ) | *
* | > "=._ | )(__/ \__)( | _.=" < | *
* | (_/"=._"=._ |/ /\ \| _.="_.="\_) | *
* | "=._"(_ ^^ _)"_.=" | *
* | "=\__|IIIIII|__/=" | *
* | _.="| \IIIIII/ |"=._ | *
* | _ _.="_.="\ /"=._"=._ _ | *
* | ( \_.="_.=" `--------` "=._"=._/ ) | *
* | > _.=" "=._ < | *
* | (_/ \_) | *
* | | *
* '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=' *
* *
* LASCIATE OGNI SPERANZA, VOI CH'ENTRATE *
*************************************************************/

Re: Comments from a Madman

2007-06-22 10:49 • by BigJim (unregistered)
One of the funniest comments I've actually seen in a production app was where the developer was restoring some data after a rollback

// OK let's do a Streisand and get back to the way we were

I had to explain to my cubemates why I was giggling uncontrollably, wondering if anyone had "outed" the guy...

Re: Comments from a Madman

2007-06-22 10:58 • by Da' Man (unregistered)
The real WTF is that the guy wrote this stuff into the source code rather than talking about it to his psychoanalyst... ;-)

Re: Comments from a Madman

2007-06-22 10:59 • by Corporate Cog (unregistered)
I write comments like this *all the time* Here are two that I just came back across in the last couple days:

/// Take that, maintenance programmer! Off by ones rule!

/// Warning!!!!!! Voodoo!!!!!! Black Magic!!!!!
/// The [object] embedded in this form is just plain weird [goes on]

It's only because I work on such a bloated, old system. No really, it is.

Re: Comments from a Madman

2007-06-22 11:02 • by Corporate Cog (unregistered)
142217 in reply to 142211
marlow4:
[code]
LASCIATE OGNI SPERANZA, VOI CH'ENTRATE


Why, oh why isn't that my trademark comment? Best comment ever (I sure hope it's real).

Re: Comments from a Madman

2007-06-22 11:20 • by rbowes
Commenting like that is strangely therapeutic, and even fun. It makes maintaining my own code interesting. I'm sure if I looked back at some old projects, I'd see comments somewhat like that. Although perhaps not so crazy.. :)

Although to be fair, my code is actually _good_. His appears to be a big kludge. Although when I did Tomcat dev, mine was a big kludge too, so I don't blame him.

Re: Comments from a Madman

2007-06-22 11:23 • by RON (unregistered)
142222 in reply to 142200
mkb:
Chris:
The part of this which I find is the most WTF is this:

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "All")
{
Jack.BoyType = BoyTypes.Dull;
}

Shouldn't that be

if (Jack.WorkQuantity == "All" && Jack.PlayQuantity == "No")
{
Jack.BoyType = BoyTypes.Dull;
}

lol, all work and all play makes jack a dull boy
(whoops, fixed it - ed.)


This is Java, so you should probably be doing if (Jack.WorkQuantity.equals("All") && Jack.PlayQuantity.equals("No"))

Come on, the author of the daily horrible code sample should know better by now!



The REAL WTF is that Java forces people to use annoying syntax when comparing strings.

I seriously don't understand how people can stand that language.

Re: Comments from a Madman

2007-06-22 11:27 • by anonymous coward (unregistered)
Can you switch the CAPTCHA to use nonsense text instead of words? Hopefully, that would get people to stop telling everyone what their CAPTCHA phrase was.

Captcha: sanitarium

Re: Comments from a Madman

2007-06-22 11:31 • by mkb
142229 in reply to 142222
RON:
The REAL WTF is that Java forces people to use annoying syntax when comparing strings.

I seriously don't understand how people can stand that language.


The real real wtf is that Java doesn't let you overload operators. AT ALL.

Re: Comments from a Madman

2007-06-22 11:57 • by MikeBeer
Here's an enum value I found:

A_DAMN_LITTLE_ITTY_BITTY_RAT_MADE_TO_SATISY_PUBLISHERS_CONTINUITY_WHINING_WHICH_NEVER_WOULD_HAVE_EXISTED_IF_THE_3D_DEPARTMENT_HADNT_RENEDERED_THE_RAT_IN_THE_FIRST_PLACE_WHICH_THEY_HAD_DONE_BECAUSE_THEY_THOUGHT_THEY_WERE_BEING_CUTE_WELL_NOW_BUDDY_WHERE_HAS_THIS_GOTTEN_US_NOW_HUH_JUST_ANOTHER_CONTINUITY_BUG_FOR_A_STUPID_LITTLE_TWO_FRAME_ANIMATION_OF_A_RAT_THAT_HAS_NOTHING_TO_DO_WHATSOEVER_WITH_THE_REST_OF_THE_GAME_IN_ANY_WAY_EXCEPT_TO_ANNOY_PROGRAMMERS_WHO_HAVE_FAR_MORE_IMPORTANT_THINGS_TO_DO_NOW_OKAY = 370,

Re: Comments from a Madman

2007-06-22 12:20 • by Godai (unregistered)
142245 in reply to 142239
I'd buy the game just to see said rat.




Mmmmm captcha tacos.

Re: Comments from a Madman

2007-06-22 12:21 • by bpk (unregistered)
drugs and software don't mix well together

Re: Comments from a Madman

2007-06-22 12:28 • by A.N.Other (unregistered)
142253 in reply to 142191
Nick:
I once added the following comment to some code I wrote...

// If you can understand this code... then I congratulate you. See me for a cookie.

I'm not going to publish the code, as it wouldn't make sense out of context... but let's just say I had Hashtables containing Hashtables containing ArrayLists. I'm not saying it was the smartest idea, but it worked.


Nothing wrong with hash tables in has tables! I have just written nested hashtables as a complex caching solution and is a quick solution. Not saying always best way though!

Re: Comments from a Madman

2007-06-22 12:40 • by PseudoNoise (unregistered)
My favorite (from an intern):

void SomeParser::OnStop ()
{
exit(0); // quit gracefully
}

Re: Comments from a Madman

2007-06-22 12:41 • by GeezerGeek
Brings back a memory from many years ago. A client I was working with had hired a "programmer" to write a CP/M BIOS. (Yes, this was well back in the day!) He brought the guy in from out of town and holed him up in a cheap motel with no transportation and very little money. The guy was in well over his head, and was being subjected to continual pressure to produce. The first release was buggy as expected, but whas shipped anyway. Soon complaints began filtering in from customers who had gone into DEBUG and viewed the BIOS code, where they encountered this (edited) text string:
Eat s*** and die John!
Shortly after that I was given the assignment to create a new BIOS, rated G.

Re: Comments from a Madman

2007-06-22 12:46 • by savar
142257 in reply to 142192
BlueKnot:
// don't ask.... okay you wanna know.

Ok... now he's talking to himself, hearing an imagined response, and answering back...

(P.S. In this case, the captcha is eerily appropriate: "alarm"!)


Look, for gods sake, the captcha is always eerily appropriate: this is an IT site and the captcha is stocked with IT terms! So stop posting your captchas already?!

Re: Comments from a Madman

2007-06-22 12:48 • by Shinobu (unregistered)
Ah, the stream of consciousness style of commenting.

Re: Comments from a Madman

2007-06-22 12:51 • by akatherder
142259 in reply to 142185
Michael:

The line is "All work and no play makes Jack a dull boy", so if Jack.PlayQuantity = "Some", then your logic would still make Jack a dull boy.

Alternatively, you could have:

if (Homer.TVQuantity == "None" && Homer.BeerQuantity == "None) {
Homer.action("Something Something");// Go crazy?
}


Don't mind if I do!

Re: Comments from a Madman

2007-06-22 12:54 • by bonzombiekitty
142260 in reply to 142253
From the project I'm currently working.


...
//OH NOESSSSS! UI BE DYING!!!
...
//Yeah, yeah, I kinda broke the implied rules for .equals().
//Sue me. You shouldn't ever be using this anyways!
...
//How the feck did the program get to this line?
...
// Yeah, I shouldn't catch an entire exception. Leave me alone.
...
//Run this as it's own thread. YAY! THREADS!!!


Also, when you shut down my program it says "You don't love me. Killing myself :( "

Re: Comments from a Madman

2007-06-22 13:15 • by Darien H (unregistered)
assert (jack.timeDistrib.get('work') + jack.timeDistrib('play') == jack.timeDistrib.total() : "Total time not divided into work or play";
if(jack.timeDistrib.get('work') == jack.timeDistrib.total()){
jack.setBoy(Boy.Dull);
}

Re: Comments from a Madman

2007-06-22 13:16 • by FredSaw
if (Jack.MethQuantity == "Lots" && Jack.PotQuantity == "Lots")
{
Jack.CodeType = CodeType.WTF;
}
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment