Comment On Probeility of Success

The Fearless Leader at Randy's company had heard wonderful things about Service-Oriented Architecture, and knew that's exactly what their in-house applications needed in order for the company to remain competitive. Obviously, in-house developers couldn't possibly have the skill or knowledge to develop such things, so the Fearless Leader brought in consultants to develop the service suite. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Probeility of Success

2010-02-15 09:04 • by ilAn (unregistered)
yawn..

Re: Probeility of Success

2010-02-15 09:06 • by JakeyC (unregistered)
Randy [snigger]

Re: Probeility of Success

2010-02-15 09:08 • by a sponsor (unregistered)
enjoyment = yawn * (++probeility_of_nap);

Re: Probeility of Success

2010-02-15 09:11 • by dkf
GES = “Global Customer Search”?

Re: Probeility of Success

2010-02-15 09:12 • by steenbergh
299087 in reply to 299086
dkf:
GES = “Global Customer Search”?

Probeily. Your GES is as good as mine...

Re: Probeility of Success

2010-02-15 09:14 • by GreyWolf
299088 in reply to 299087
steenbergh:
dkf:
GES = “Global Customer Search”?

Probeily. Your GES is as good as mine...


Post of The Day

Re: Probeility of Success

2010-02-15 09:16 • by Cbuttius
A probeility is a probability factored by 100, it would seem.

Re: Probeility of Success

2010-02-15 09:17 • by Wolfan (unregistered)
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)
299091 in reply to 299090
Wolfan:
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.

Don't ever bother applying for a job at my company.

Re: Probeility of Success

2010-02-15 09:26 • by Confused in Ct (unregistered)
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?


Re: Probeility of Success

2010-02-15 09:27 • by Sprite_tm (unregistered)
Otoh, the variable name probeility and the int minScore; minScore+=(float)3.8; can't be excused that easily.

Re: Probeility of Success

2010-02-15 09:29 • by David (unregistered)
I particularly like the variable scoring based upon how often getLastName() comes in and out of scope at any given (nano)moment.

Re: Probeility of Success

2010-02-15 09:30 • by Matt (unregistered)
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


Re: Probeility of Success

2010-02-15 09:31 • by ascii (unregistered)
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)
299097 in reply to 299090
Wolfan:
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.


You probably did not see the "real WTFs" ;o)

What about

if (srvRequest.getLastName() != null && srvRequest.getLastName() != null)
...
else if (srvRequest.getLastName() != null)
...

Re: Probeility of Success

2010-02-15 09:41 • by Wolfan (unregistered)
299099 in reply to 299091
Anonymous:
Wolfan:
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.

Don't ever bother applying for a job at my company.


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)
299101 in reply to 299091
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)
299102 in reply to 299099
Wolfan:
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!


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;
299103 in reply to 299090
Wolfan:
I saw more interesting stuff when I was tutoring in college.


So now we know who teaches all these people to be WTF coders.

Re: Probeility of Success

2010-02-15 09:59 • by Anonymous (unregistered)
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)
299105 in reply to 299102
riddums:
Wolfan:
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!


No, it's because you claim to have atrocious code standards and not think anything of it.

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.

Re: Probeility of Success

2010-02-15 10:05 • by steenbergh
299106 in reply to 299104
Anonymous:
What language is this? It looks like java but it shouldn't even compile then...


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)
299108 in reply to 299106
So what happens in C# when you do
int i = (float) 3.14


What is in i?

Re: Probeility of Success

2010-02-15 10:12 • by Lars Vargas
299109 in reply to 299108
Anonymous:
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".

Re: Probeility of Success

2010-02-15 10:14 • by fluffy777
getLastName must be implemented like this:


class MemberRequest {
public String getLastName() {
return names_.removeLast();
}
private LinkedList<String> names_;
}


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)
299111 in reply to 299108
Anonymous:
So what happens in C# when you do
int i = (float) 3.14


What is in i?


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)
299112 in reply to 299087
steenbergh:
dkf:
GES = “Global Customer Search”?

Probeily. Your GES is as good as mine...


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.


Re: Probeility of Success

2010-02-15 10:22 • by steenbergh
299113 in reply to 299111
riddums:
Anonymous:
So what happens in C# when you do
int i = (float) 3.14


What is in i?


I'm not exactly sure but doesn't an implicit downcast cause a C# compiler error?


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...)

Re: Probeility of Success

2010-02-15 10:24 • by David (unregistered)
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)
299115 in reply to 299108
.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)
299116 in reply to 299090
Wolfan:
This is just the kind of mistake people leave in when they are debugging...Simply human mistake, IMNHO.
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.

Re: Probeility of Success

2010-02-15 10:56 • by Thomas (unregistered)
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)
299120 in reply to 299118
Thomas:
I dont understand the line

if(srvRequest.getLastName() != null && srvRequest.getLastName() != null) ..

.. i would have wrote
if(srvRequest.getLastName() != null && true)
instead ;)


Obviously you don't have much experience in Side-Effect Based Programming.

Re: Probeility of Success

2010-02-15 11:06 • by ObiWayneKenobi
The code snippet is Java, not C#.

Re: Probeility of Success

2010-02-15 11:09 • by Gutter Mind (unregistered)
299122 in reply to 299119
The Flaming Foobar:
...
I feel enjoyed. Thank you!


That's what she said! *rim shot*

Re: Probeility of Success

2010-02-15 11:19 • by Anonymous (unregistered)
299123 in reply to 299108
Anonymous:
So what happens in C# when you do
int i = (float) 3.14


What is in i?

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:

int i = (int)3.14F;

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.

Re: Probeility of Success

2010-02-15 11:24 • by Bubba (unregistered)
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)
299125 in reply to 299111
riddums:
Anonymous:
So what happens in C# when you do
int i = (float) 3.14


What is in i?


I'm not exactly sure but doesn't an implicit downcast cause a C# compiler error?


Yes.

Re: Probeility of Success

2010-02-15 11:28 • by Anon (unregistered)
Optimized:


public float calculateWeight( MemberRequest srvRequest, int probeility)
{
return 2 * probeility / 100;
}

Re: Probeility of Success

2010-02-15 11:29 • by Guriga (unregistered)
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.

Re: Probeility of Success

2010-02-15 11:34 • by Patrick (unregistered)
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)
299130 in reply to 299106
steenbergh:
Anonymous:
What language is this? It looks like java but it shouldn't even compile then...


I think it's C#, but what's the difference.

*ducks for cover*


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.


int i = (int)((float)4.12);


Would work but would be utterly horrible. You would be more likely to see:


int i = (int)4.12F;


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.

Re: Probeility of Success

2010-02-15 11:46 • by Z (unregistered)
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)
299132 in reply to 299126
Anon:
Optimized:


public float calculateWeight( MemberRequest srvRequest, int probeility)
{
return probeility / 50;
}


Re: Probeility of Success

2010-02-15 11:49 • by Sam (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)
299134 in reply to 299105
Anonymous:
riddums:

No, it's because you claim to have atrocious code standards and not think anything of it.

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.


Hold on a second guys...

Wolfan:
IMNHO


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. :-)

Re: Probeility of Success

2010-02-15 12:15 • by Your Name (unregistered)
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.

Re: Probeility of Success

2010-02-15 12:17 • by J (unregistered)
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."

Re: Probeility of Success

2010-02-15 12:19 • by Resistance
299138 in reply to 299110
fluffy777:
getLastName must be implemented like this:


class MemberRequest {
public String getLastName() {
return names_.removeLast();
}
private LinkedList<String> names_;
}


So, duh, of course you need to check both the lastname and the next-to-last-name! It's in the spec!

Soon people will run out of last names
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment