- 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
I think TRWTF is that there is a line of code that makes you want to punch babies. I would suggest some therapy... Or prison.
CAPTCHA: causa, I post this causa you wanna punch babies eh!
Admin
Admin
Admin
Yes, if you try and compile as C#
Cannot implicitly convert type 'float' to 'int'. An explicit conversion exists (are you missing a cast?)
Admin
Its not supposed to be declared as an int. The guy who posted it added that. Its a class member declared as a float, which is another WTF you guys can argue about lol...
Admin
Admin
FTFY- You attributed the quote to the wrong jerk.
Admin
If you're going to optimize the logic, you might as well go ahead and fully simplify the arithmetic as well:
public float calculateWeight( MemberRequest srvRequest, int probeility)
{
}
Admin
Contractors come and go. This was the first and last work they did for the employer. This isn't the first time the employer has done this and no, they don't deserve any sympathy. The poor suckers (e.g. me) that not only have to try to make this steaming pile work but were punished for questioning the qualifications of the contractors/consultants early on do deserve some sympathy, IMO. At least in such a soft job market.
Admin
Safe optimization:
Would be a bit more complicated if the language happened to be only a Java-lookalike with operator overloading. But making any kind of sane assumption of code like this (e.g. that "getters" are const-correct) is just plain silly.
Admin
"in-hose developers"... was that on purpose or a deliciously funny typo?
Admin
ROFLMAO!
Admin
Come one, it's obvious if you look well;
the probeility (which is just short for probable being less than infinity) is an int containing a float representing either TRUE, FALSE or FILE_NOT_FOUND, which gets checked two be one of two of the possible three values predefined in the value 2 in the overloaded = operator. If so (or not, or filenotfound), it gets randomly distributed over one hundred specific buckets (with '/') one of which might or might not result in the closeness of the target being less than infinity.
Makes sense to me.
Admin
Yeah?
Admin
Yeah? What do you want?
Admin
Maybe you tutored the consultant who wrote this nugget?
Admin
Of course the employer deserves sympathy. If you take your car to a mechanic and he puts water in the engine instead of oil would you want sympathy.
These were "consultants" which means they were payed very high rates to do a specialist job. Whoever wrote this is a fraudster and should be hung from the nearest tree.
Admin
Hell, I've written brainfuck. One actually difficult language is Malbolge. http://en.wikipedia.org/wiki/Malbolge#Programming_in_Malbolge