Comment On Happy (Belated) Jed Day!

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 ... [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5Next »

Re: Happy (Belated) Jed Day!

2005-09-09 14:09 • by 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 ...



wow.  there goes a real asshat.

Re: Happy (Belated) Jed Day!

2005-09-09 14:12 • by Jake Heidt
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.

Re: Happy (Belated) Jed Day!

2005-09-09 14:14 • by Duckie
43465 in reply to 43459
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.


Re: Happy (Belated) Jed Day!

2005-09-09 14:15 • by John Smallberries
43466 in reply to 43461
OMFG.

This guy is just a monumental waste of carbon.


Re: Happy (Belated) Jed Day!

2005-09-09 14:16 • by StarManta
43468 in reply to 43461
Anonymous:

People like JED should be exported to india.


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

Re: Happy (Belated) Jed Day!

2005-09-09 14:19 • by Ronald Frown

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.

Re: Happy (Belated) Jed Day!

2005-09-09 14:19 • by Rain dog
43471 in reply to 43459
It's obvious that the functions he wrote were meant to be humerous and to waste his time.

Re: Happy (Belated) Jed Day!

2005-09-09 14:20 • by Mike R

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


 

Re: Happy (Belated) Jed Day!

2005-09-09 14:24 • by stewie
43474 in reply to 43472
My favourite line:



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


Re: Happy (Belated) Jed Day!

2005-09-09 14:25 • by christoofar
43475 in reply to 43459
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.

Re: Happy (Belated) Jed Day!

2005-09-09 14:27 • by Jed

upcomming jed methods...


MostlyTrue
AreMostlyEqual


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


NotTrue
NotEqual
MainlyFalse

Re: Happy (Belated) Jed Day!

2005-09-09 14:32 • by J
43480 in reply to 43477

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.


 


 

Re: Happy (Belated) Jed Day!

2005-09-09 14:36 • by christoofar
43481 in reply to 43466
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 */

Re: Happy (Belated) Jed Day!

2005-09-09 14:43 • by Philip Stephens
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.

Re: Happy (Belated) Jed Day!

2005-09-09 14:44 • by Mung Kee
43483 in reply to 43465
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!"

Re: Happy (Belated) Jed Day!

2005-09-09 14:45 • by zephc
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.

Re: Happy (Belated) Jed Day!

2005-09-09 14:50 • by RyGuy
43486 in reply to 43484

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!

Re: Happy (Belated) Jed Day!

2005-09-09 15:01 • by bugsRus


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

Re: Happy (Belated) Jed Day!

2005-09-09 15:01 • by Disgruntled DBA
43488 in reply to 43486
// 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!

Re: Happy (Belated) Jed Day!

2005-09-09 15:03 • by David Knaack
43489 in reply to 43480
"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;





Re: Happy (Belated) Jed Day!

2005-09-09 15:03 • by Stan James
43490 in reply to 43486
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.

Re: Happy (Belated) Jed Day!

2005-09-09 15:11 • by Free

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.


 

Re: Happy (Belated) Jed Day!

2005-09-09 15:19 • by whojoedaddy

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

Re: Happy (Belated) Jed Day!

2005-09-09 15:21 • by Maurits
Alex Papadimoulis:
there should be 2^2 [4] possible outcomes


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

Re: Happy (Belated) Jed Day!

2005-09-09 15:23 • by ItsAllGeekToMe

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

Re: Happy (Belated) Jed Day!

2005-09-09 15:24 • by Yoda
U Think Jed talks to Obi-Wan Knobi?

Re: Happy (Belated) Jed Day!

2005-09-09 15:29 • by Apu
43499 in reply to 43461
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-)





Re: Happy (Belated) Jed Day!

2005-09-09 15:30 • by David Knaack
43500 in reply to 43497
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.

Re: Happy (Belated) Jed Day!

2005-09-09 15:35 • by Brad Brening

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


Whew.  Almost lost my lunch there...

Re: Happy (Belated) Jed Day!

2005-09-09 15:37 • by Scoutn
Ah, before this I forgot that Delphi had goto. Thank you Jed, for opening my eyes to a whole new world of possibilities. ;)

Re: Happy (Belated) Jed Day!

2005-09-09 15:40 • by Joe
I hope it wasn't this JED http://www.jed-software.com/



He contributes a lot to the Delphi community.

Re: Happy (Belated) Jed Day!

2005-09-09 15:41 • by David P. Murphy
  // 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


Re: Happy (Belated) Jed Day!

2005-09-09 15:42 • by dubwai
43508 in reply to 43481

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?

Re: Happy (Belated) Jed Day!

2005-09-09 15:42 • by ammoQ
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.

Re: Happy (Belated) Jed Day!

2005-09-09 15:44 • by Michael Casadevall
43510 in reply to 43503
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.

Re: Happy (Belated) Jed Day!

2005-09-09 15:49 • by Brent Seidel
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.

Re: Happy (Belated) Jed Day!

2005-09-09 15:53 • by ammoQ
43513 in reply to 43508
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.

Re: Happy (Belated) Jed Day!

2005-09-09 15:58 • by retnuh
Damn it, I've got a lot of work to do this afternoon and this post just made me dumber, thanks alot thedailywtf.com

Re: Happy (Belated) Jed Day!

2005-09-09 16:00 • by normal
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!

Re: Happy (Belated) Jed Day!

2005-09-09 16:01 • by nsimeonov
43516 in reply to 43510

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.

Re: Happy (Belated) Jed Day!

2005-09-09 16:04 • by nsimeonov
43518 in reply to 43459
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 ...



wow.  there goes a real asshat.



 


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.

Re: Happy (Belated) Jed Day!

2005-09-09 16:06 • by dubwai
43519 in reply to 43513
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.

Re: Happy (Belated) Jed Day!

2005-09-09 16:11 • by Mike K.
43520 in reply to 43481
"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".

Re: Happy (Belated) Jed Day!

2005-09-09 16:13 • by RayMarron
43521 in reply to 43510
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".

Re: Happy (Belated) Jed Day!

2005-09-09 16:22 • by David Knaack
43524 in reply to 43506
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.



Re: Happy (Belated) Jed Day!

2005-09-09 16:34 • by David Knaack
43527 in reply to 43516
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.

Re: Happy (Belated) Jed Day!

2005-09-09 16:36 • by emptyset
43528 in reply to 43518
nsimeonov:
great and how will you call yourself for defending the person who wrote the original code?

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.

Re: Happy (Belated) Jed Day!

2005-09-09 16:38 • by Gene Wirchenko
43529 in reply to 43483
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



Re: Happy (Belated) Jed Day!

2005-09-09 16:40 • by Gene Wirchenko
43530 in reply to 43519
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




Re: Happy (Belated) Jed Day!

2005-09-09 16:41 • by Rudy Velthuis
43531 in reply to 43505
> 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.

« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5Next »

Add Comment