| « Prev | Page 1 | Page 2 | Page 3 | Next » |
|
Randy [snigger]
|
|
enjoyment = yawn * (++probeility_of_nap);
|
|
GES = “Global Customer Search”?
|
Probeily. Your GES is as good as mine... |
Post of The Day |
|
A probeility is a probability factored by 100, it would seem.
|
|
I saw more interesting stuff when I was tutoring in college. This is just the kind of mistake people leave in when they are debugging, not really a WTF. I've done it before. You say to your self: "Okay so there's no real data in this thing, but I want to generate the search to see how the other function will react after it calls this function, but this function will return nothing right now because it needs data to run. I could make up test data or just have it make a number for right now so I can test the other thing" Simply human mistake, IMNHO.
|
Re: Probeility of Success
2010-02-15 09:25
•
by
Anonymous
(unregistered)
|
Don't ever bother applying for a job at my company. |
|
let me see if I understand this correctly...
if a contact has a postal code and if they really, really have a last name ... otherwise if they have a last name ... otherwise they're Anonymous? |
|
Otoh, the variable name probeility and the int minScore; minScore+=(float)3.8; can't be excused that easily.
|
|
I particularly like the variable scoring based upon how often getLastName() comes in and out of scope at any given (nano)moment.
|
|
Well I really enjoyed this one, its laden with WTFs.
the minor WTFs (perhaps even TRWTFs) being: return is float yet minScore is declared int and everywhere the values its given are cast as floats the checking of srvRequest.getLastName() != null twice in one if(), then again in the else if() the totally arbitary values assigned |
|
This one is worth 3.8! That one's only worth 3.2!
No, they're both only worth 3. Nice try with the cast-to-float, though. |
Re: Probeility of Success
2010-02-15 09:36
•
by
methinks
(unregistered)
|
You probably did not see the "real WTFs" ;o) What about
|
Re: Probeility of Success
2010-02-15 09:41
•
by
Wolfan
(unregistered)
|
Oh gods, please why no don't. Now I must plummet from the roof of my building since it hurts so bad. You mean I can't have a job at some random guy/girls company because I have a different opinion on an article!? Oh the pain! |
Re: Probeility of Success
2010-02-15 09:48
•
by
eViLegion
(unregistered)
|
|
You had probably best not post anonymously when making such demands. It makes them almost impossible to comply with.
|
Re: Probeility of Success
2010-02-15 09:50
•
by
riddums
(unregistered)
|
No, it's because you claim to have atrocious code standards and not think anything of it. |
Re: Probeility of Success
2010-02-15 09:56
•
by
java.lang.Chris;
|
So now we know who teaches all these people to be WTF coders. |
|
What language is this? It looks like java but it shouldn't even compile then...
|
Re: Probeility of Success
2010-02-15 10:03
•
by
Anonymous
(unregistered)
|
Exactly. It's a totally appalling attitude to have towards coding standards and I have a suspicion that most of the folks on this site would agree. |
I think it's C#, but what's the difference. *ducks for cover* |
Re: Probeility of Success
2010-02-15 10:08
•
by
Anonymous
(unregistered)
|
|
So what happens in C# when you do
int i = (float) 3.14 What is in i? |
It's similar to pi, but after someone takes a "p". |
|
getLastName must be implemented like this:
So, duh, of course you need to check both the lastname and the next-to-last-name! It's in the spec! |
Re: Probeility of Success
2010-02-15 10:18
•
by
riddums
(unregistered)
|
I'm not exactly sure but doesn't an implicit downcast cause a C# compiler error? |
Re: Probeility of Success
2010-02-15 10:19
•
by
justsomedude
(unregistered)
|
Hey, I see what you did there. This WTF may be boreing, but wow, that's a heck of a serious fail. I don't think there's a line of code that dooesn't make me want to punch babies. It's bad enough when developers are sloppy and don't care, but that's nothing compared to this wonderful example of incompentence. |
I'm more used to working with VB.Net, and VB doesn't have any problems eating this shit-for-code if you do not specify "option strict". Perhaps C# is equally 'flexible'. Perhaps it's only a warning (and I doubt these developers care about warnings...) |
|
getLastName() - so good they Nulled it twice :-)
But I have no explanation at all for all those pointless (float) assignments to int minScore I believe it was Niklaus Wirth who said, some 40 years ago, "There is not now and never will be any language in which it is the least bit difficult to write bad programs. Clearly this applies to C# as much as to any other. |
Re: Probeility of Success
2010-02-15 10:24
•
by
Sucky SQL Dufus
(unregistered)
|
|
.net's System.Convert can handle this (may round or truncate, not sure which) but c# certainly won't compile w/ an implicit cast like this.
|
Re: Probeility of Success
2010-02-15 10:27
•
by
Kevin
(unregistered)
|
Yeah, that's why you put in a comment like "// Debug value" or something because you know you're only human and won't remember every little detail from you're mad debugging session. |
|
I dont understand the line
if(srvRequest.getLastName() != null && srvRequest.getLastName() != null) .. .. i would have wrote if(srvRequest.getLastName() != null && true) instead ;) |
Re: Probeility of Success
2010-02-15 10:57
•
by
The Flaming Foobar
(unregistered)
|
|
Wow, this is like the Zen of WTF.
I read it once and was, "wtf". I read it again and saw some more. I read it once more and saw even more. I read the comments and couldn't believe I had missed some. I feel enjoyed. Thank you! |
Re: Probeility of Success
2010-02-15 11:00
•
by
just me
(unregistered)
|
Obviously you don't have much experience in Side-Effect Based Programming. |
|
The code snippet is Java, not C#.
|
Re: Probeility of Success
2010-02-15 11:09
•
by
Gutter Mind
(unregistered)
|
That's what she said! *rim shot* |
Re: Probeility of Success
2010-02-15 11:19
•
by
Anonymous
(unregistered)
|
Nothing is in i, the code does not compile. If you want to cast between a float and an int it must be an explicit cast. So you'd need to do this:
In this snippet, your value of 3.14 is defined as a float by virtue of the postfix "F". It's then being explictily cast to an integer using (int). The result in variable i is 3. |
|
This doesn't make me think "WTF?"
This is the expected outcome when clueless dolts hire 'consultants' to weave magic from the latest development hype. CAPTCHA - "appellatio" - like a hummer, only fruitier. |
Re: Probeility of Success
2010-02-15 11:26
•
by
Someone too lazy to login and at work
(unregistered)
|
Yes. |
|
Optimized:
|
|
assuming a sensible range of 0..100 of probeility
probeility < 50 -> 0 probeility < 100 -> 1 probeility = 100 -> 2 However, on embedded systems with low processing power it is standard to use approximative lookup tables for costy functions instead of applying the functions themselves. |
|
Casting to a float and assigning to an int would cause a compile error in C#. The lastname&&lastname thing probably should have been firstname&&lastname, and the final minscore=2 may have been part of a deleted else but was left behind. This is what I'd call a 'midnight bug' - the result of writing code when you should be sleeping - at the very least, they're easy to fix.
|
Re: Probeility of Success
2010-02-15 11:39
•
by
Someone too lazy to login and at work
(unregistered)
|
It doesn't look like C# to me, for a start you can't assign a float to an int in C#, you'd have to cast the float to an int.
Would work but would be utterly horrible. You would be more likely to see:
Which would be more normal; in an equally horrible kind of way. I also wouldn't expect to see get* methods in C#, you'd just use properties (which compile to methods, but still). Not that it really makes any difference what language it's in, it's horrible code, not least because it loses precision with impunity. |
|
Further optimized:
public float calculateWeight(int probeility) { return probeility / 50; } Thank me later |
Re: Probeility of Success
2010-02-15 11:47
•
by
Chuck
(unregistered)
|
|
|
Casting a float to an int just truncates in C#. 3.14 becomes 3, and so on.
But as people said you can't implicitly do it, so the code in the article won't compile. That being said I don't know what language it's in. |
Re: Probeility of Success
2010-02-15 12:04
•
by
Foobarbaz
(unregistered)
|
Hold on a second guys...
As soon as someone is so conceited that they feel that they can't just say something is their opinion, but that they have to say that its their _not humble_ opinion, I always find it best to completely ignore them. And if they're a coder, chances are they're not a very good one. The best coders I've met have pretty much always been humble and modest. So... bad code standards is just the tip of the iceberg is what I'm saying. :-) |
|
Spelling error aside, it kinda looks like something went screwy with a change commit. Either someone committed something that they shouldn't have, or a merge got AFU.
|
|
On top of the WTF's in the implementation, I'm still trying to figure out exactly what this software is supposed to accomplish.
"Okay, if the two people have the same zip code and last name but different first names and birthdays, there's a 12% chance that they're the same person." |
Soon people will run out of last names |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |