- 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
WIN!
Admin
Whoever wrote that article seems to be the one that's "in a rush", judging by all the copy/paste errors.
-- Note from Alex: Whoa. I swear, at like 3AM last nite it looked perfect! (Fixed)
Admin
Hey give Alex a break, he's all wiped after having to implement some impossible features that were sold to a customer.
As for the: public long getLength() { return 1000000; // no clue }
I am afraid I have done something similar from time to time, when I am going through some inherited code where the original dev is long gone, and putting in something like // OMGWTF I can't believe this #$$@#
Why do I put that in there? Venting or something, I guess...
Admin
The comments for validation one is something I'd do while still learning to program effectively. Of course I'd go back and replace them with code before putting it into production.
As for optimusPrime = new Transformer() - that is teh awesome! :oD
Admin
All of this is fine on embedded platforms which might not have a file system.
Admin
It's a bit unfair to just clip bits of code out of context. If you'd left in the public class PieceOfString bit the getLength method makes perfect sense!
Admin
Sure the PHP guy wasn't in a rush. He had simply could use strip_tags instead of his own function.
facilisi -- facilis is latin for easy to do
Admin
Transformer optimusPrime = new Transformer();
is this a wtf because it's cool?
captcha: vulputate - A vulture that likes tater tots.
Admin
Half because it's cool, half because jokes shouldn't go in production systems I guess.
Admin
I find all this anti-Italic sentiment disturbing.
Admin
Transformer optimusPrime = new Transformer(); is only cool if you're working in a graphical environment and instantiating models for rendering where you can pass the constructor arguments, like 'TRUCK', or 'ROBOT', or 'GORILLA' (for the optimusPrimal version).
Admin
In that case, it helps to have something greppable (such as FIXME) in the placeholder comments to make sure it doesn't get forgotten before deploying the code.
Admin
class Transformer
class Transformers : Transformer, Collection
Transformer optimusPrime = new Transformer();
Transformers autobots = new Transformers();
optimusPrime->Address(autobots);
optimusPrime->IssueCommand("Transform!!!!");
AwesomeSoundEffectsFactory::GetSoundEffect("ch ch ch CH!")->Play();
Admin
I'm pretty sure that the first function posted (the more I read into it) is a waste of space.
Admin
I tried to put some italic tags around a bit of text today, but somehow, it doubled my text
I tried to put some italic tags around a bit of text today, but somehow, it doubled my text
Admin
Admin
Admin
Indeed, and the Optimus Prime bit might have been from code for a Transformers game, in which case it's perfectly cromulent.
Admin
That's exactly what I did. "FIXME" and "TODO write this code" are good, though I've still a soft spot for "banana"
Admin
Wow, you poke at Alex just a little bit, and your comments get deleted? That's really, well, sad. I do understand that everyone makes mistakes, but on a Blog that's dedicated to pointing out mistakes, that's just kind of well hypocritical. Everyone here has made a WTF including you Alex.
-- Note from Alex: there were several comments pointing out typos/mistakes, but since the errors were fixed, the comments were no longer relavent; I did keep one, which was at the top and was a good balance of poking fun at me and explaining the original problem. On the same note, comments that respond to this will probably be deleted, too, since it's double-meta (I think?) discussion.
Admin
Too right. I have been guilty of similar naming conventions, like having a boolean flag to indicate if the current user is local or remote (in circumstances where "local" security has been requested to be lower for convenience on the assumption that other protections will mitigate the extra risk) called b_from_round_these_parts. Then you can check
(needs to be read in either a west country accent or with a hick slur)Admin
Actually, this should be a function of latitude - see http://en.wikipedia.org/wiki/Gravitational_acceleration.
For us here in Sweden, 9.82 is the best approximation.
Admin
That would make it even more of a WTF since the article states:
"I was going through some obscure code from the developers before me, and something caught my eye," Philippe wrote. "It was a class whose task was to transform data, and this is how it was instantiated."
Admin
Admin
Admin
Admin
Amateur.
Public Function Newton() Newton= kgf() End Function
Admin
As a mech engineer, I would say it is not too bad, it makes sure you always use the same value and a known accuracy for g trougout the program.
Some people use 9,81, others just 9,8 and some others round it to 10, and the actual value depends on a lot of things ( where you are on the globe, position of the moon....)
This allows get some accuracy of the result and eventualy improve it.
Admin
RE the italics that become bold I would say that using italic tags is the real wtf. Though it feels strange to redefine this in css, html wasn't meant for defining presentation. That's why you have and . It is unfortunate tags like or exist at all.
Since you can redefine everything in css it is a mistake to think those tags will do what you think.
Admin
RE the italics that become bold I would say that using italic tags is the real wtf. Though it feels strange to redefine this in css, html wasn't meant for defining presentation. That's why you have and . It is unfortunate tags like or exist at all.
Since you can redefine everything in css it is a mistake to think those tags will do what you think.
Admin
Admin
The Newton function probably is to avoid having a magic number in a calculation. Seems to me that's generally considered A Good Thing, not a WTF.
Admin
Hey man, this is VB. Parentheses optional.
Admin
Admin
You're the one that does
#define ONE 1 #define TWO 2
aren't you?
Sometimes you really don't need it.
Admin
Agreed - the only problem I might possibly have with it is its name - NewtonsPerKg would be better - but as a concept it's fine. No WTF.
Admin
Admin
Admin
In this case none of yours are. Get over yourselves.
Now as to whether this comment about useless comments being useless is useful... Well that's a different question entirely....
Admin
Admin
We? Is there a frog in your pocket? For the dense, "senior software consultant" is a callback to the article.
Admin
I agree that it's preferable to use EM and STRONG in place of I and B but redefining expected behaviour is definitely a WTF in my book.
Admin
This was a deliberate feature to tell you to stop using to italicise text. The correct XHTML-compliant tag is .
Admin
Admin
Admin
That was referring to a copy and paste error that Alex has now fixed. Kudos on O'Rly, thuogh. It's ages since I've seen one.
Admin
Strangly by discussing about the spelling of relevant you have created a triple-meta comment.
Admin
Agree. If you hardcode the values you may screw up badly. For example, Alice calculates the force as F = 9.81 * m. Later Bob wants to do the inverse so he calculates m = F / 9.8128. Then the swedish guy comes along and calculates F again as F = 9.82 * m. You'd better wish they're programming a game and not the guidance system for an Ariane V rocket.
Sure, I'd prefer a constant to a function but it's still better than hardcoded values...
Admin
Admin