• (cs)
    Alex Papadimoulis:

    A little while back, David Knaack wrote in to tell me about August 29th, a day revered by him and his colleagues. August 29th is, after all Jed Day: the anniversary of Jed's 'de-hiring' date. David explains why they consider this such a celebratory event ...

    <FONT face="Courier New" size=2>wow.  there goes a real asshat.</FONT>

  • Jake Heidt (unregistered)

    WTF is with these asshats programmers and their IsTrue, IsEqual, what moron would USE these, let alone WRITE them.

    People like JED should be exported to india.

  • Duckie (unregistered) in reply to emptyset

    Ohh my f***ing god !

    I just love this part:!

    // need to set the result if it hasn't been set yet, we'll randomly decide true or false
    // because there should be no bias.

  • (cs) in reply to Jake Heidt

    <font size="2">OMFG.
    This guy is just a monumental waste of carbon.</font>

  • StarManta (unregistered) in reply to Jake Heidt
    Anonymous:
    People like JED should be exported to india.

    But why would you want to give people like Jed our jobs? :D

  • Ronald Frown (unregistered)

    wow.

    I've seen stuff like this in the wild... and given I can read, but not write delphi code... WOW.

    I dont think his implementation of his homebrew exceptionhandling is where the WTF ends... looks like a huge cluster.

  • Rain dog (unregistered) in reply to emptyset

    It's obvious that the functions he wrote were meant to be humerous and to waste his time.

  • (cs)

    Methinks Jed needed to lay off the cough syrup a bit.

     

  • (cs) in reply to Mike R

    My favourite line:

     // count the number of true expressions (WARNING: COMPLEX CODE AHEAD!!)

  • (cs) in reply to emptyset

    Having been a Delphi developer for years, since version 1.0 came out for Windows 16-bit, I can tell you this guy doesn't represent the vast majority of Delphi programmers out there who do know OO basics and certainly would never pull shit like that.

    That being said, this guy is probably on the same wavelength as the crakz and hax0rs who use Delphi to write the single-exe cracking utilities I've seen proliferating here and there on the web; most of whom believe in their little hearts that because they have a grasp on how to write procedural Pascal within OO-Pascal programs and can drop to assember with the ASM keyword, they are "leet".

    Of course, there are a bunch of bad Delphi programmers out there... if you ever use an application and see an "Access Violation at address 0xDEADF00D" while doing something in the app, 99% of the time it's an inexperienced Delphi coder.

  • Jed (unregistered)

    upcomming jed methods...

    MostlyTrue
    AreMostlyEqual

    and for those who still get confused by the concept of negating a value

    NotTrue
    NotEqual
    MainlyFalse

  • J (unregistered) in reply to Jed

    I don't know Delphi but wtf?

    TrueCount:=(1-1); // get 'real zero'

    Is 0 not 0?  There HAS to be some logic behind this madness.

     

     

  • (cs) in reply to John Smallberries

    On further reflection, the company I work for now "strongly encouraged" my predecessor to leave the firm... who also was very adamant about not ever raising exceptions (in VB) and using what I like to call a magic variable called "bContinue", which another nameless soul who also was terminated used in his C++ code to track errors through the course of method execution.

    /* sigh */

  • Philip Stephens (unregistered)

    My guess is that guy liked to goof off a lot, and found it more interesting to f*ck with the heads of future maintainers of his code than do real work.  What's sad is that if he had so much time to write satirical functions, why didn't he use more subtle humour and REALLY mess with the poor saps that would have to read his code?  Ah well.

  • (cs) in reply to Duckie
    Anonymous:
    Ohh my f***ing god !

    I just love this part:!
    // need to set the result if it hasn't been set yet, we'll randomly decide true or false
    // because there should be no bias.


    Yeah, you don't want your code to be politically incorrect.  The ACLU may come down on you.


    "Equal treatment for true AND false!  Equal treatment for true AND false!"

  • (cs)

    I tihnk this guy is most closely the Alex Chiu (http://alexchiu.com/) of programming. That is, apparent ability to be prolific (in the sense that he can write a lot) while having almost no idea about real patterns, methodologies, etc.

    Also, lines like "WARNING: COMPLEX CODE AHEAD!!" indicate he thinks most people won't be able to understand his, ahem, brillance.

    A couple helpings of humble pie and a real computer science education might turn him into a decent coder.

  • (cs) in reply to zephc

    My favorite line:


     // set up a simple 'boolean fall-through grid', there should be 2^2 [4] possible outcomes
      // because there are two states being compared (true and false) for each of the
      // two expressions (expression1 and expression2), I've numbered them for easy counting.

    4 possible outcomes?!??!  Good thing he numbered them.  I would have lost track had he not!

  • (cs)



    ...snip...

     // if the auto-breakout feature hasn't kicked in yet then "there is a serious problem"...
    begin
    ShowMessage('there is a serious problem');
    Halt;
    end;

    ...snip...



    At least he had descriptive error messages.

  • Disgruntled DBA (unregistered) in reply to RyGuy

    // if the auto-breakout feature hasn't kicked in yet then "there is a serious problem"...
    begin
    ShowMessage('there is a serious problem');
    Halt;
    end;

    Oooh! Oooh! We have a candidate for pop-up pot luck next week!

  • David Knaack (unregistered) in reply to J

    "Jed" often used constructs like the following:

        case IsPositive of
          True: 
            begin
               // ...
            end;
          False: 
            begin
              // ...
            end;
        end;

    Where 'IsPositive' is a method parameter of type Boolean.  This works as long as the caller always passes a 'real' boolean, something where the ordinal value is 0 or 1.  As soon as some joker passes in something like Boolean( 3 ) the case will drop through without matching either True or False.  An IF statement tests the ordinal value of the variable against zero (effectively), so it will never fail under these conditions.

    When I pointed this out to "Jed", he saw the error of his ways.  Thereafter he always wrote this:

        case (IsPositive=True) of

          True: 

            begin

               // ...

            end;

          False: 

            begin

              // ...

            end;

        end;


  • Stan James (unregistered) in reply to RyGuy

    I'm sure he was just laughin his ass off. Reminds me of a brilliant friend who wrote a 370 assembler macro that chose registers at random so as not to wear one out by overuse.

  • (cs)

    I find one thing odd about all the people I have encountered who prefer HResults and reference paramters in languages that support exceptions:

    They don't emulate a specific well-know system like C (HResult), they do something different. And most of them ignore the result.

     

  • (cs)

    <sarcasm>I don't think I could have understood his code w/o his helpful comments</sarcasm>

    This has to be debugging code. No one would create a moretrue function would they? I think my favorite comments are:
    // find out more about the 'not' operator in the online help.
    (WARNING: COMPLEX CODE AHEAD!!)

    What's up with all the quotes?

  • (cs)
    Alex Papadimoulis:
    there should be 2^2 [4] possible outcomes


    Glad he included the "4".  Here I was thinking that 2^2 == 0.
  • (cs)

    whoever wrote this code deeeeeefinitely realized how assinine it was.  not a true wtf.......

  • Yoda (unregistered)

    U Think Jed talks to Obi-Wan Knobi?

  • Apu (unregistered) in reply to Jake Heidt
    Anonymous:
    WTF is with these asshats programmers and their IsTrue, IsEqual, what moron would USE these, let alone WRITE them.

    People like JED should be exported to india.


    There are some people even we tolerant Indians won't accept 8-)


  • David Knaack (unregistered) in reply to ItsAllGeekToMe
    ItsAllGeekToMe:

    whoever wrote this code deeeeeefinitely realized how assinine it was.  not a true wtf.......



    Agreed.  There are so many true wft's in his code that I couldn't decide which one to submit first.  It is also difficult because many of them are architectural in nature and difficult to convey in a code snippit.  I thought that this would be an entertaining introduction.  I will endeavor to extract the more compact WTF's and submit them.
  • Brad Brening (unregistered)

    "ShowMessage('there is a serious problem');"

    Whew.  Almost lost my lunch there...

  • Scoutn (unregistered)

    Ah, before this I forgot that Delphi had goto. Thank you Jed, for opening my eyes to a whole new world of possibilities. ;)

  • Joe (unregistered)

    I hope it wasn't this JED http://www.jed-software.com/

    He contributes a lot to the Delphi community.

  • David P. Murphy (unregistered)

      // need to set the result if it hasn't been set yet
    if IsTrue(ResultHasBeenSet)=IsTrue(0=1)

    Either I'm unfamiliar with this language or it recurses infinitely.

    ok
    dpm


  • (cs) in reply to christoofar

    christoofar:
    On further reflection, the company I work for now "strongly encouraged" my predecessor to leave the firm... who also was very adamant about not ever raising exceptions (in VB) and using what I like to call a magic variable called "bContinue", which another nameless soul who also was terminated used in his C++ code to track errors through the course of method execution.

    /* sigh */

    What do you mean?  How else are you going to ensure your 500 line method has a single exit point?

  • (cs)

    Anyone noticed that IsTrue - and therefore the other functions - don't work at all? IsTrue looks like an infinite recursion to me. So it's not only a stupid joke, it's also dangerous - a coworker might be tempted to use MoreTrue if he needs it for some reason.

  • (cs) in reply to Scoutn

    This looks like Pascal more then Delphi (although I haven't use either language that much).

    If this guy just learned some coding shortcuts, he could write some good code.

  • Brent Seidel (unregistered)
    Alex Papadimoulis:

    (*---------------------------------------------------------------------------
      Procedure:   IsTrue
      Author:      jed
      Date:        26-Aug-2003
      Description: useful for determining the boolean result of an expression
    ---------------------------------------------------------------------------:*)
    function IsTrue(Expression: TExpression): Boolean;
    var
      ResultHasBeenSet: Boolean;
    begin
      Result:=(Random(2)=0)=True;
      ResultHasBeenSet:=False;
    

    // if the expression is true then the result will be true, otherwise (since the // expression couldn't be true) the result will be false. There are no other // mathematical possibilities begin if (Expression=True) then begin Result:=True; ResultHasBeenSet:=True; end;

    if (Expression=False) then
    begin
      Result:=False;
      ResultHasBeenSet:=True;
    end;
    

    end;

    // need to set the result if it hasn't been set yet, we'll randomly decide true or false // because there should be no bias. if IsTrue(ResultHasBeenSet)=IsTrue(0=1) then Result:=((Random(2)=Random(2))=True) else Result:=(Result=True);

    // P.S. // This function could also be adapted to tell you if some expression is false // by prefixing the expression (or the result) with the 'not' operator. You can // find out more about the 'not' operator in the online help. end;

    I find it interesting that the IsTrue function is potentially recursive. Not that this will actually ever happen, but...

    It is also intersting that Result is initialized to a random(!) true/false value and then later checked to see if it was set and if not, set to another random true/false value.

    This is one of the most beautiful things I've seen in a while. It mean that I should have no trouble finding work when the need arises.

  • (cs) in reply to dubwai
    dubwai:

    What do you mean?  How else are you going to ensure your 500 line method has a single exit point?



    Use a *heavenbeware* GOTO? Throw the same exception at the end of every possible execution path? BTW: What's the reason for trying to have a single exit point?  It kind of forces you to write smaller methods, which is mostly a good thing; but if you keep your large methods and fill them with lots of nested ifs, magic bContinues or similar your code will hardly be more readable.
  • (cs)

    Damn it, I've got a lot of work to do this afternoon and this post just made me dumber, thanks alot thedailywtf.com

  • (cs)
    Alex Papadimoulis:
        then Result:=((Random(2)=Random(2))=True)


    Oh, I see the WTF now.  Jed only needed to get one random number and compare that to a non-random number like this:


    Alex Papadimoulis:
        then Result:=((Random(2)=0)=True)


    He's wasting a call to Random!

  • (cs) in reply to Michael Casadevall

    OMFG! This is the worst code ever. It's even worse than the code I saw in the Hotel Reservation System from Hell. The entire design was terrible but the guy's mind who actually wrote it wasn't even as half as twisted as Jed's. Unbelievable. I couldn't imagine someone could write such a masterpieces. Numbering your variables and adding comments what are they about could be a bad habbit from the old days of Applesoft Basic or some other ancient machine where you can't have more than 2 letters and a number for your variables, but what I see here ... are you sure you didn't alter his functions intentionally? That looks like a result from a competition "Who will write the worst code about operators and simple functions". Any chance to see something more complex from this guy? Like a function to sort 2 arrays for example, hmm?

     

    Sonic McTails:
    This looks like Pascal more then Delphi (although I haven't use either language that much).

    Actually Delphi is the name of the RAD (rapid application development) product from Borland using ObjectPascal to write the code. And object pascal on it's turn is actually pascal with a number of additions like classes and properties (the list is long actually)

    Sonic McTails:
    If this guy just learned some coding shortcuts, he could write some good code.

    No way! I wouldn't hire anyone like him - it's a terrible waste of time - he needs close guidance for at least a year until he un-learns his bad habbits and figures out how to write normal code. Now I see why 3/4th of the people who apply for a position don't even bother responding after I ask for some code they wrote.

  • (cs) in reply to emptyset
    emptyset:
    Alex Papadimoulis:

    A little while back, David Knaack wrote in to tell me about August 29th, a day revered by him and his colleagues. August 29th is, after all Jed Day: the anniversary of Jed's 'de-hiring' date. David explains why they consider this such a celebratory event ...

    <FONT face="Courier New" size=2>wow.  there goes a real asshat.</FONT>

     

    great and how will you call yourself for defending the person who wrote the original code? May I suggest a five-letter word starting with "m" and ending with "n"?

    in my company a person like Jed would not only be fired, but I would charge him for the extra time, other developers would need to clean his crap.

  • (cs) in reply to ammoQ
    ammoQ:
    dubwai:

    What do you mean?  How else are you going to ensure your 500 line method has a single exit point?

    BTW: What's the reason for trying to have a single exit point?

    Gotos are bad.  Returning from the middle of a method is a goto.  QED.

  • Mike K. (unregistered) in reply to christoofar

    "bContinue"? And you're from the philadelphia area? Please, PLEASE give me this person's initials! I worked with a bunch of incompetent morons about 5 years ago whose code was riddled with "bContinue".

  • (cs) in reply to Michael Casadevall
    Sonic McTails:
    This looks like Pascal more then Delphi (although I haven't use either language that much). (snip)
    Delphi is, essentially, Object-oriented extensions to Pascal called "Object Pascal". Recently, Borland decided to just call the language "Delphi".
  • David Knaack (unregistered) in reply to David P. Murphy
    Anonymous:
      // need to set the result if it hasn't been set yet
    if IsTrue(ResultHasBeenSet)=IsTrue(0=1)

    Either I'm unfamiliar with this language or it recurses infinitely.



    Correct.  You will need the following to compile and test it:

    type
       TExpression = Boolean;

    Running it will get a 'Stack overflow' exception.  It would have been more entertaining if it would recurse to random depth I think.

  • David Knaack (unregistered) in reply to nsimeonov
    nsimeonov:

     are you sure you didn't alter his functions intentionally?


    'Pon my honor, this is as-written.

    nsimeonov:

    Any chance to see something more complex from this guy? Like a function to sort 2 arrays for example, hmm?


    I'll see what I can find in the utlitity libraries he wrote.  Most of that code is quirky, but not terribly WTFish.  Most of what he produced is in the screwy overall architecture of the application.  It's very difficult to modify and produces some devilish bugs, but the errors are so widespread that its hard to point at a particular piece as an example.
  • (cs) in reply to nsimeonov
    nsimeonov:
    great and how will you call yourself for defending the person who wrote the original code?

    <FONT face="Courier New" size=2>i can see how my quoting was a little confusing.  i meant to trim most of the HUGE post, and in retrospect, i should have chosen a better portion.  i wasn't really paying attention.  i think we are in agreement that JED is the asshat.</FONT>

  • (cs) in reply to Mung Kee
    Mung Kee:
    Anonymous:
    Ohh my f***ing god !

    I just love this part:!
    // need to set the result if it hasn't been set yet, we'll randomly decide true or false
    // because there should be no bias.

    Yeah, you don't want your code to be politically incorrect.  The ACLU may come down on you.


    "Equal treatment for true AND false!  Equal treatment for true AND false!"


    "Equal treatment for true AND false!  Equal treatment for false AND true!"

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to dubwai
    dubwai:
    ammoQ:
    dubwai:

    What do you mean?  How else are you going to ensure your 500 line method has a single exit point?

    BTW: What's the reason for trying to have a single exit point?

    Gotos are bad.  Returning from the middle of a method is a goto.  QED.


    I hope you are not serious.

    Sincerely,

    Gene Wirchenko

  • Rudy Velthuis (unregistered) in reply to Joe

    > I hope it wasn't this JED http://www.jed-software.com/


    > He contributes a lot to the Delphi community.


    Very unlikely. Jeremy North is in Australia.

Leave a comment on “Happy (Belated) Jed Day!”

Log In or post as a guest

Replying to comment #:

« Return to Article