- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
It's a start
Admin
COMMENT ME!
(Someone was bound to do it...)
Admin
That would work on me... I'd see those and my anal-retentiveness would insist I fix them.
No documentation looks a lot cleaner than bad documentation.
Admin
Who needs self-documenting code when you have self-documenting documentation?
Admin
Mostly Harmless.
Admin
Come on, I've seen much better machine generated documentation than that, mostly in Help dialog boxes:
calculateExpiryScale is a public int method that accepts 1 parameter: keyCode which is a String. It may throw a KeyCodeInvalidException if the KeyCodeInvalidException condition arises during processing.
And really, if you're any good, what more do you need to know?
Admin
Why stop there?
/**
Admin
The worst part is that any good java documentation generator would generated better comments before that garbage was added.
Instead the documentation becomes a useless pile of horse crap!
!FACE~PALM!
Admin
Admin
A CVS commit hook that changes the file this is to be committed? CVS hook scripts are not allowed to do this. I can imagine some real crude hack to do it, but other than that?
Admin
Why stop even there?
/**
Admin
Admin
Admin
/**
Admin
Hmmmm... the JavaDoc lists the param as 'foo' which doesn't match the method param name. JavaDoc warning!
Admin
"This was the only documentation required by Central IT."
That's more documentation that I usually see.
Admin
FTFY. You're welcome.
Admin
If I see one more class with a comment at the top that says "Describes the behaviour of this class" I'm going to cry....
Admin
When you say something like this, the rest of the article just becomes filler.
Admin
Hey, it could've been worse.
Admin
If Central IT is a division of Central Services, I can understand the need for all documentation to be in order, no matter what.
Robert should be happy that his last name isn't Tuttle, er, Buttle.
Admin
Admin
That's not how thedailywtf.com works. The anonymizer has been upgraded to an anonymizer,embellisher,and grandioser. Like all upgrades, there have been some bugs, and it frequently obfuscates, conflicticates, shuffles, or deletes chunks of text.
Trying to piece together the details of an article can lead to extreme brain trauma, or worse you might actually connect the points into a narrative which would probably break several universal constants, killing us all.
Just chuckle at the moral of the story and come back for more tomorrow.
Admin
/**
Admin
Checking for dependencies..
Admin
/**
Admin
At last, back to the good old days of a story that takes less time to read than it did to write. Leaving you with time to go "WTF"...
Admin
Standards ask for every entity to be documented in JavaDoc. Now they are, and the check-if-standards-are-met script does not complain. Central IT people aren't bothered with thousands of warnings and are happy again.
The same could be done with: check-if-standards-are-met > /dev/null; echo "PERFECT!";
Admin
I had a wtf like this once. I was moving a bunch of legacy code from one directory to another (and doing a little renaming of classes etc) as part of a reorg, and was told by the chief architect to put empty unit tests in all the files. Apparently the rationale was "it makes it inconvenient for people to not test their code if I insist on empty unit tests".
Admin
Admin
Admin
Admin
Why bother with details?
/*
Admin
Admin
Someone make a documentary about this!
Admin
/** Please remember:
Admin
Aaargh! You've reminded me of a WTF I'd mercifully managed to forget. On one of my first jobs we had a mandatory subroutine header-comment template that was about 80 lines. That's right - a subroutine header template, not a file header template. Which meant that each source file consisted of over half boilerplate which was, of course, almost never filled in. And nearly all of which would not have been useful even if it had been filled in.
I attempted to pursuade the person responsible of the futility of this, but his response was something like "that's the standard, quit moaning".
I've often wondered whether people are born that stupid, or if they have to work on it.
Admin
/**
Admin
It sounds like a good thing to me. No developer time wasted against their will, and a placeholder is there for someone to fill in the next time they work on it.
My main problem with these boilerplate documentation schemes is that it makes the code seem more permanent. Being able to delete or restructure things is good, and investing extra work into something makes you feel less likely to toss it. Especially other people's work.
Admin
Funnily enough... Doxygen likes to utterly ignore anything that doesn't have a doc comment. Throwing in an empty or duff doc comment will make Doxygen generate much better documentation than it would otherwise create.
Admin
check-if-standards-are-met might crash, hang, write data on stderr, or interfere with the operation of some other program on the build machine. Best to just remove it completely, and skip to the echo command.
You can do the same thing with the build system, unit tests, bug tracker, and systems monitoring tools too. It really makes life much, much easier.
Admin
/**
Well, you were just asking for this, weren't you?
Admin
Admin
Admin
So Central IT was worried that only 53.8% of the code was documented? How about the system I am currently working on, with entire classes that don't have any useful comment whatsoever?
What matters most is that classes and members have good names, and that comments have useful information where it's needed - not that you attach comments to every single member.
Admin
/**
Admin
Just to put an end to the cascade, I submit a final entry, inspired by Carl Sagan's "apple pie from scratch" recipe:
Admin
Damn. I was genuinely disappointed to realize at the bottom that Commentator 1.0 doesn't exist. :(
Thanks for that though.
Admin
Mine would too. I would do a replace all "DOCUMENT ME !" with "This feature is currently undocument." It would look a lot cleaner, and it would take almost no additional effort.
Admin
Not really - it just reiterates the method signature, which you already have. That's no use, so it's basically undocumented. What might be actually useful is a comment about what the method is for.