• For the rest of us (unregistered) in reply to justsomedude
    justsomedude:
    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.

    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!

  • Quirkafleeg (unregistered) in reply to riddums
    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?
    A warning at most, I should hope. If not, we're doomed...
  • Quirkafleeg (unregistered) in reply to Nobody
    Nobody:
    So what happens in C# when you do int i = (float) 3.14
    pi is exactly 3!
    You are Bergholt Stuttley Johnson and I clain my AM$5.
  • DW (unregistered) in reply to riddums
    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, if you try and compile as C#

    Cannot implicitly convert type 'float' to 'int'. An explicit conversion exists (are you missing a cast?)

  • dfdfdf (unregistered)

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

  • (cs) in reply to frits
    frits:
    ... having misspelled words or variable names in poorly written code (not spelling errors on otherwise workable code, but on piss-poor, retardocalyptically badly written code) usually shows that the original developer either didn't give a rat's ass about quality (or the employer who was paying him his salary) or was completely clueless and overwhelmed and should be kept away from source code in the name of anything that is holy.
    Of course, it was the employer who paid for the author of said code to write it and I'm guessing it must have been fairly obvious what sort of developer they were and that this was not their first offence, so I strongly suspect the employer doesn't deserve any sympathy.
  • (cs) in reply to Iain Collins
    Iain Collins:
    luis.espinal:
    ... having misspelled words or variable names in poorly written code (not spelling errors on otherwise workable code, but on piss-poor, retardocalyptically badly written code) usually shows that the original developer either didn't give a rat's ass about quality (or the employer who was paying him his salary) or was completely clueless and overwhelmed and should be kept away from source code in the name of anything that is holy.
    Of course, it was the employer who paid for the author of said code to write it and I'm guessing it must have been fairly obvious what sort of developer they were and that this was not their first offence, so I strongly suspect the employer doesn't deserve any sympathy.

    FTFY- You attributed the quote to the wrong jerk.

  • anonymouse (unregistered) in reply to Anon

    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)

    {

    return probeility / 50;
    

    }

  • Anonymous Coward (unregistered) in reply to Iain Collins
    Iain Collins:
    Of course, it was the employer who paid for the author of said code to write it and I'm guessing it must have been fairly obvious what sort of developer they were and that this was not their first offence, so I strongly suspect the employer doesn't deserve any sympathy.

    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.

  • Anonymouse (unregistered)

    Safe optimization:

    public float calculateWeight(MemberRequest srvRequest, int probeility)
    {
        if (srvRequest.getZipCode() != null) {
          srvRequest.getLastName();
          srvRequest.getLastName();
        }
    
        srvRequest.getDateOfBirth();
        srvRequest.getID1();
        srvRequest.getID2();
        srvRequest.getPhoneNumber();
        srvRequest.getID3();
        srvRequest.getID4();
    
        return (float)(2 * probeility / 100);
    }
    

    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.

  • (cs) in reply to exInhouse
    exInhouse:
    Hmm. This looks familiar. I think I was there. I was one of the in-hose developers. We were powerless to stop it. All we could do was watch in horror.

    The horror.

    THE HORROR!!

    "in-hose developers"... was that on purpose or a deliciously funny typo?

  • Rodnas (unregistered) in reply to steenbergh
    steenbergh:
    dkf:
    GES = “Global Customer Search”?
    Probeily. Your GES is as good as mine...

    ROFLMAO!

  • caster (unregistered)

    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.

  • Randy Snigger (unregistered) in reply to JakeyC
    JakeyC:
    Randy [snigger]

    Yeah?

  • Randy Snigger (unregistered) in reply to JakeyC
    JakeyC:
    Randy [snigger]

    Yeah? What do you want?

  • KillBert (unregistered) in reply to Wolfan

    Maybe you tutored the consultant who wrote this nugget?

  • KillBert (unregistered) in reply to Iain Collins

    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.

  • recursive (unregistered) in reply to Patrick
    Patrick:
    Green Zebra:
    David:
    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."

    I disagree. It is quite easy to create a language in which it is absolutely impossible to write bad programs.

    Of course, such a language would make it impossible to write good programs, but that's not part of the spec.

    It's called brainf*ck (http://www.muppetlabs.com/~breadbox/bf/)

    Hell, I've written brainfuck. One actually difficult language is Malbolge. http://en.wikipedia.org/wiki/Malbolge#Programming_in_Malbolge

    Malbolge was so difficult to understand when it arrived that it took two years for the first Malbolge program to appear. The program was not even written by a human being: it was generated by a beam search algorithm designed by Andrew Cooke and implemented in Lisp.

Leave a comment on “Probeility of Success ”

Log In or post as a guest

Replying to comment #299486:

« Return to Article