It's a Linear Failure Structure

« Return to Article
  • fw 2010-04-06 09:05
    I can't get my head around comments
  • SonicLover 2010-04-06 09:06
    Fir... nah, just kidding.

    I'm not extremely code-savvy... could someone explain why the "echo if" line is so bad?

    CAPTCHA: aptent - a tent Gary definitely has not been camping under
  • Tihrd, Not changing this awesome name. 2010-04-06 09:06
    Well? What was the book?
  • JayT 2010-04-06 09:06
    "Steve treated the entire dev team to a round at the local pub to celebrate"

    Sounds like something my manager would do, nothing says "thank you for your efforts" like a pint and maybe a burger...
  • Severity One 2010-04-06 09:07
    Maybe Steve should have explained to Gary that arrays are like trains of identical cars, or perhaps he should have used the word "choo-choo".

    Nah, forget that, he'd probably still be confused.
  • Mike 2010-04-06 09:08
    Needless to say, I won't be purchasing any PHP books with "Gary" as a co-author. (A simple Amazon search reveals a prime candidate to avoid.)
  • Remusonline 2010-04-06 09:10
    Not good enough for the industry? No problem, your lack of skills will be the basis for our future software engineers!

    No wonder why software projects are taking so long these days...
  • SR 2010-04-06 09:11
    This book?

    From the reviews "Then I got confused with inadequate explanation ofarrays"

    BTW I have no idea what
    echo if (isset($bob +1000)) ;
    could possibly be there for. Literally no idea.
  • Severity One 2010-04-06 09:11
    SonicLover:
    I'm not extremely code-savvy... could someone explain why the "echo if" line is so bad?

    If you're not code-savvy, what are you doing here? :)

    Anyway, echo what exactly? You could rewrite it as follows:
    if( isset( $bob + 1000 )
    
    {
    echo;
    }

    ...which doesn't make a lot of sense.

    Also, using isset() on an expression is... rather unusual.
  • SR 2010-04-06 09:12
    SonicLover:
    CAPTCHA: aptent - a tent Gary definitely has not been camping under


    Wanna go camping? There's an app for that.

    I'll get my coat.
  • java.lang.Chris; 2010-04-06 09:16
    Book credits look great on a CV, but given the poor quality of a lot of IT books they shouldn't be taken at face value. My predecessor had a book credit, as he'd edited one chapter of a book for a newer edition. I wasn't surprised that the book was out of print, having been criticised heavily on Amazon, nor that his chapter was hopelessly incorrect (it was a Sams publication, and I managed to find a free online version to check).
  • wintermute 2010-04-06 09:16
    SonicLover:
    Fir... nah, just kidding.

    I'm not extremely code-savvy... could someone explain why the "echo if" line is so bad?


    Because the isset bombs out with an error when there's more than a simple variable name in there.

    Because (even if you get rid of the "+1000", so that it will actually run), it doesn't output anything.
  • TheAnonCoward 2010-04-06 09:19
    The only two real WTF's I can spot here are Gary himself and the fact that he actually co-authored a book that was published on the subject.

    The fact that he was sacked is certainly enough to save this story from the true annals of WTFery.
  • Mr H 2010-04-06 09:21
    As a PHP developer I can verify that the statement
    echo if (isset($bob +1000)) ;
    not only is pointless but also invalid. If the CWTF(Creator of the WTF) was as gifted in php/perl as he claimed he should have been able to write a driver program to traverse the website directory and copy files to a seperate directory. This assumes that there were no WTFs already in the web site creation (absolute paths, URI references, etc.)
  • Drew 2010-04-06 09:22
    Arrays? Seriously? Can't get your head around arrays?

    Recursion, maybe I could excuse. Certain kinds of trees if you haven't messed with them in a while. But arrays?
  • Tiigon 2010-04-06 09:23
    Obviously Gary is one of those "real coders" who use XML for everything. Arrays are so last year!
  • Anon 2010-04-06 09:24
    Two syntax errors in a one-liner is a bit too much for such a guru...
  • Khepra 2010-04-06 09:26
    SR:
    This book?

    From the reviews "Then I got confused with inadequate explanation ofarrays"

    BTW I have no idea what
    echo if (isset($bob +1000)) ;
    could possibly be there for. Literally no idea.


    Comments on book:
    "I struggled just getting started with running stuff, but blamed myselfrather than the book. Then I got confused with inadequate explanation ofarrays..."
  • eViLegion 2010-04-06 09:28
    How can a programmer fail to understand arrays?

    Its like a baker not getting yeast, or a politician not understanding lies.
  • Crash 2010-04-06 09:30
    Let's work from left to right to see what's wrong with this simple one-liner. This is narrated in the voice of the PHP while attempting to run the code.

    echo - Okay, we're going to print something to the screen. Got it, we're ready. Let's do this!

    if - Wait, what? 'If' doesn't return anything so how can we echo this? Oh boy.

    isset - alright, so we're inside a conditional apparently. Let's check if this variable is set...that's not a variable, that's an expression! Who let this moron near a computer? Let's try to evaluate the expression anyway. Alright, $bob plus 1000. I really hope $bob is a number of some kind in order for that expression to work. Let's assume it's correct and $bob is, in fact, an integer - we'll pretend $bob = 1. isset(1+1000)...WTF? see below explanation of isset.

    ; (semicolon) - The conditional is done...and we have no instructions to execute after it so it does nothing...this was a waste of time.

    isset is a PHP construct that tests variables to see if they're set to a value. You can pass it multiple variables, each variable as a parameter. You can't pass it an expression or it will vomit up a parse error.

    Captcha: vulputate. Sounds dirty.
  • Robert 2010-04-06 09:31
    I have lost all faith in tech books now
  • Thg 2010-04-06 09:34
    Drew:
    Arrays? Seriously? Can't get your head around arrays?

    Recursion, maybe I could excuse. Certain kinds of trees if you haven't messed with them in a while. But arrays?


    I can't get my head around "else" statements.
    Does anyone know of any good online references?

    Otherwise, I can give links to online "goto" resources in trade.

    goto captcha;
    /*NOTREACHED*/
  • highphilosopher 2010-04-06 09:34
    Unfortunately we tend to hide things in languages. Programmers don't have to use arrays, so the lazy ones won't pick it up. 5-10 years ago a programmer would have said "How can you not know how to do bitwise operations!" yet I find myself explaining it to developers all the time.
  • Your Name 2010-04-06 09:35
    I find it unbelievable that Gary was that bad of a programmer and nobody noticed.

    I find it really unbelievable that Steve would hire Gary and not at least check on the quality of his work the first few weeks.

    Seriously, before anyone enters the door here for an interview they need to pass a simple programming / debugging test. Candidates also need to bring or be able to show code. We get that stuff out of the way quickly, and then move on to figuring out if someone is a good fit.

    Anyone who claims to be an "expert", though, gets seriously grilled.
  • Jonny 2010-04-06 09:38
    It's not like anybody is going to need arrays anyway.
  • Mark Bowytz 2010-04-06 09:41
    If I could feature this one twice, I would. Now I have the voice of PHP in my head.
  • jonnyq 2010-04-06 09:51
    I've described PHP as an array-oriented language before...

    If you don't understand arrays, then you don't understand PHP at all.

    (This isn't a good or bad this... just a very very particular thing about PHP)
  • Niraj 2010-04-06 09:54
    just by any chance -- http://www.amazon.com/o/ASIN/0764557440

  • Crash 2010-04-06 09:59
    Guess who's missing from the the updated version of the book...

    http://www.amazon.com/Beginning-Apache-MySQL-Development-Programmer/dp/0764579665/ref=sr_ob_1?ie=UTF8&s=books&qid=1270562131&sr=1-1
  • Socket 2010-04-06 10:11
    I have that book... I feel cheated now.
  • Dave 2010-04-06 10:11
    Crash:
    Guess who's missing from the the updated version of the book...

    http://www.amazon.com/Beginning-Apache-MySQL-Development-Programmer/dp/0764579665/ref=sr_ob_1?ie=UTF8&s=books&qid=1270562131&sr=1-1


    I like that he was also photo-shopped out of the cover. Not that they could leave him in there...
  • Crash 2010-04-06 10:14
    Dave:

    I like that he was also photo-shopped out of the cover. Not that they could leave him in there...


    Priceless, especially since he's the only one that isn't in the new edition so there's no doubt which one he is.
  • Gruntled Postal Worker 2010-04-06 10:15
    Niraj:
    just by any chance -- http://www.amazon.com/o/ASIN/0764557440



    TDWTF usually anonymizes the articles. Are you sure 'Gary' is really called 'Gary'?
  • jonsjava 2010-04-06 10:15
    Wow. Gotta say, it must be this guy He seems like a crock. Maybe I'm wrong, but doesn't this seem like a spin on the story:

    http://uk.linkedin.com/in/garymailer:

    #
    Analyst Developer
    Aardvark Media

    (Privately Held; 1-10 employees; Internet industry)

    May 2001 — September 2001 (5 months)

    • Identified opportunity and facilitate implementation of improvement of core application for major client.
    • Played a major role in the team that developed an innovative Pan-European Extranet for Siemens Communications.
    • As part of team identified the business and functional requirements.
    • Designed and developed parts of the system that met those requirements within timescale and budget.
    • Facilitated regular project reviews both internally and with client, face to face.
    #
    Analyst Developer
    Motion Pixels

    (Privately Held; 1-10 employees; Information Technology and Services industry)

    August 2000 — February 2001 (7 months)

    • Management of ongoing systems development and enhancement of large client website.
    • Undertook requirement analysis, systems design and implemented solutions, and provided support for new pieces of development. Including black box and user acceptance testing.
    • Identified opportunities for improvements as well as ensuring they were commercially viable.

  • Remy Porter 2010-04-06 10:20
    Gruntled Postal Worker:

    TDWTF usually anonymizes the articles. Are you sure 'Gary' is really called 'Gary'?


    For disclaimer's sake, any resemblance to real PHP authors is purely coincidental. And hilarious.

    Seriously, though, Gary is an absurdly common name, so I wouldn't go drawing any conclusions. The names could have just as easily been flipped around, and you'd all be hunting for an author named Steve.
  • jonsjava 2010-04-06 10:25
    Forgot to mention: his CV looks like a bad movie sequel, "Fired in 60 Seconds":

    Left after 2 years
    Left after 7 months
    Left after 5 months
    Left after 8 months
    Left after 2 months
    Left after 5 months
    Left after 1 month
    Left after 7 months
    Left after 2 years, 8 months (getting nitpicky now)
    Left after 11 months
    And last, but not least:

    2 years, 7 months
    That makes 11 jobs in 10.9 years.
  • Crash 2010-04-06 10:28
    Remy Porter:

    For disclaimer's sake, any resemblance to real PHP authors is purely coincidental. And hilarious.

    Seriously, though, Gary is an absurdly common name, so I wouldn't go drawing any conclusions. The names could have just as easily been flipped around, and you'd all be hunting for an author named Steve.


    We're the internet. We'll find you a Steve to mock as well, if you want - just give us a bit.
  • grzlbrmft 2010-04-06 10:31
    Crash:
    We're the internet. We'll find you a Steve to mock as well, if you want - just give us a bit.


    I'd like to have a Nepomuk, please.
  • anon 2010-04-06 10:38
    Gruntled Postal Worker:
    Niraj:
    just by any chance -- http://www.amazon.com/o/ASIN/0764557440



    TDWTF usually anonymizes the articles. Are you sure 'Gary' is really called 'Gary'?


    Let's hope so, then we can work out which firm he worked for:
    -- http://uk.linkedin.com/in/garymailer
  • jonsjava 2010-04-06 10:39
    grzlbrmft:
    I'd like to have a Nepomuk, please.


    As requested:
    hxxp://commons.wikimedia.org/wiki/Johann_Nepomuk_Geiger

    Warning: This one is kinda raunchy
  • JoeB 2010-04-06 10:40
    Believing that Gary is actually THAT Gary, I find it amusing that the review of the book has an Array topic, and the first (as claimed here - could not check) does not.
  • Xero 2010-04-06 10:42
    Did you notice Gary isn't listed in the newer version of the book.
  • Russ 2010-04-06 10:43
    Robert:
    I have lost all faith in tech books now


    I was there a LONG time ago. More often than not, books are the result of those who can't do anything else.
  • grzlbrmft 2010-04-06 10:44
    jonsjava:

    As requested:
    hxxp://commons.wikimedia.org/wiki/Johann_Nepomuk_Geiger
    Warning: This one is kinda raunchy


    That's not so bad. I like his style.
  • Anonymous Coward 2010-04-06 10:45
    I wonder if this is the book in question:

    http://www.amazon.com/Beginning-PHP-Apache-MySQL-Development/dp/0764557440/ref=sr_1_fkmr1_2?ie=UTF8&qid=1270564714&sr=8-2-fkmr1

    It's the only PHP book Amazon threw up that had someone named 'Gary' in the list of authors. And, also, I find it highly suspect that the most recent edition is missing a particular author:

    http://www.amazon.com/Beginning-Apache-MySQL-Development-Programmer/dp/0764579665/ref=dp_ob_image_bk
  • Remy Porter 2010-04-06 10:49
    Crash:

    We're the internet. We'll find you a Steve to mock as well, if you want - just give us a bit.


    Please do. The Gary hunt is getting a bit out of hand.
  • Skilldrick 2010-04-06 10:53
    I think Remy is getting really worried about the anonymisation in this article now...
  • Doug 2010-04-06 11:00
    Crash:
    Let's work from left to right to see what's wrong with this simple one-liner. This is narrated in the voice of the PHP while attempting to run the code.

    echo - Okay, we're going to print something to the screen. Got it, we're ready. Let's do this!

    if - Wait, what? 'If' doesn't return anything so how can we echo this? Oh boy.

    ...


    I don't do PHP, but PERL uses this construct all the time:

    print if (condition);

    But, since this is PERL("timtowtdi"), this is functionally the same as:

    if (condition) { print; }

    Gary probably just got his languages mixed up.
  • JamesQMurphy 2010-04-06 11:02
    Russ:
    Robert:
    I have lost all faith in tech books now


    I was there a LONG time ago. More often than not, books are the result of those who can't do anything else.


    That is particularly true when it comes to Wrox books. Irish Girl could author one.
  • Nobody 2010-04-06 11:07
    If that first linked book is any indication of Gary's involvement... the one-star review certainly seals the deal, IMO.

    Worst book of all time, sorry guys and gals but whoever wrote and edited this book should buy a book themselves "Learn to Write and Edit by DUMMIES". To many typo's and script errors which did not work!

    Actually I would give the book a 5 star rating if they changed the name to Trouble Shooting Script Errors, Test Your Skills!
  • ZaM 2010-04-06 11:16
    I'm waiting a 4chan style raid against that poor guy
  • Jake 2010-04-06 11:25
    I started losing faith in tech books around the time I read O'Reilly's "Linux System Administration". I skimmed through it at the store thinking, "hmm this looks pretty decent", and bought it.

    Later on I thoroughly read the chapter on NTP, which included a description of the algorithm and some other interesting bits. At the end of the chapter was a half-page or so on how to actually set it up. So how do you use NTP? You set up a cron job like this:

    0 0 * * * rdate <server>

    *headdesk*

    Closer examination of other topics yielded other oddities, but that's the one I remember. It spent the next couple years bouncing around on the passenger floorboards of my truck, being used as a footrest. It was good at that.

    Also, my captcha is surprisingly close to "fellatio". Coincidence or prophecy?
  • Yazeran 2010-04-06 11:27
    Doug:

    I don't do PHP, but PERL uses this construct all the time:

    print if (condition);

    But, since this is PERL("timtowtdi"), this is functionally the same as:

    if (condition) { print; }

    Gary probably just got his languages mixed up.


    True, it could be that, but that print statement still has nothing to do (no variable or expression except the magical $_).

    Granted if it was Perl he could have been using that (I would call that extremely bad style in anything but oneliners).
    But I do not think that $_ is in PHP (although I do not work with PHP at all, so I could be wrong)

    Yours Yazeran
  • Philipp 2010-04-06 11:27
    Gary loved finding other people's mistakes. He made it a habit to shoulder-surf the other coders and give them a "real-time code review". The little list of stupid mistakes he gathered would then be brought up again in meetings so that Gary could pretend to be some sort of hero, like he was holding the entire shop together.


    Gary sounds like a typical dailywtf.com commenter :)
  • Not a Nepomuk 2010-04-06 11:29
    The real Nepomuk

    http://en.wikipedia.org/wiki/Johann_Nepomuk_Hiedler
  • frits 2010-04-06 11:37
    Philipp:
    Gary loved finding other people's mistakes. He made it a habit to shoulder-surf the other coders and give them a "real-time code review". The little list of stupid mistakes he gathered would then be brought up again in meetings so that Gary could pretend to be some sort of hero, like he was holding the entire shop together.


    Gary sounds like a typical dailywtf.com commenter :)


    It's thedailywtf.com, and you forgot the period at the end of the sentence. Good thing I'm here to police these crappy comments.
  • ObiWayneKenobi 2010-04-06 11:40
    NO WONDER THAT PHP BOOK WAS TERRIBLE! It all makes sense now!
  • Anonymous 2010-04-06 11:44
    Hi there, mystery editor. I like your name.
  • sui 2010-04-06 11:44
    just a matter of context, obfuscating and non-space-whitespace in function names. watch this working example:

    http://www.sui.li/if.php
    http://www.sui.li/if.phps
  • RBoy 2010-04-06 11:53
    Crash:
    Let's work from left to right to see what's wrong with this simple one-liner...


    I nominate you for the official code explainer of the Daily WTF.
  • amischiefr 2010-04-06 12:02
    Crash:
    Guess who's missing from the the updated version of the book...

    http://www.amazon.com/Beginning-Apache-MySQL-Development-Programmer/dp/0764579665/ref=sr_ob_1?ie=UTF8&s=books&qid=1270562131&sr=1-1


    And if you look at his LinkedIn page, you can see that he has had 11 jobs in as many years :)

    http://uk.linkedin.com/in/garymailer
  • Cygnus 2010-04-06 12:09
    One of the worst programmers (though a very nice person) I ever worked with went on to publish several programming books. I thought about purchasing one or more out of curiosity but I didn't want to waste my money. Strange how those who "can't do" seem to think they can teach.
  • Steve H 2010-04-06 12:32
    Crash:
    Let's work from left to right to see what's wrong with this simple one-liner. This is narrated in the voice of the PHP while attempting to run the code.

    echo - Okay, we're going to print something to the screen. Got it, we're ready. Let's do this!

    if - Wait, what? 'If' doesn't return anything so how can we echo this? Oh boy.

    isset - alright, so we're inside a conditional apparently. Let's check if this variable is set...that's not a variable, that's an expression! Who let this moron near a computer? Let's try to evaluate the expression anyway. Alright, $bob plus 1000. I really hope $bob is a number of some kind in order for that expression to work. Let's assume it's correct and $bob is, in fact, an integer - we'll pretend $bob = 1. isset(1+1000)...WTF? see below explanation of isset.

    ; (semicolon) - The conditional is done...and we have no instructions to execute after it so it does nothing...this was a waste of time.

    isset is a PHP construct that tests variables to see if they're set to a value. You can pass it multiple variables, each variable as a parameter. You can't pass it an expression or it will vomit up a parse error.

    Captcha: vulputate. Sounds dirty.


    You really think you can only put a variable in an if()?

    You're hardly the person to be commenting on others' code now, are you.
  • DrJDX 2010-04-06 12:38
    sui:
    just a matter of context, obfuscating and non-space-whitespace in function names. watch this working example:

    http://www.sui.li/if.php
    http://www.sui.li/if.phps
    I'm not entirely sure if it'd be better or worse if you were right. Syntactically correct, sure, but that's the kind of code a monster would write.
    Steve H:
    You really think you can only put a variable in an if()?

    You're hardly the person to be commenting on others' code now, are you.
    You, turn in your "reply" button now, you have failed at reading; we should go ahead and collect up your quote button as well.
  • Anonymous 2010-04-06 12:41
    Cygnus:
    One of the worst programmers (though a very nice person) I ever worked with went on to publish several programming books. I thought about purchasing one or more out of curiosity but I didn't want to waste my money. Strange how those who "can't do" seem to think they can teach.

    Those who can, do.
    Those who can't, teach.
  • Anon 2010-04-06 12:42
    Anonymous Coward:
    I wonder if this is the book in question:

    http://www.amazon.com/Beginning-PHP-Apache-MySQL-Development/dp/0764557440/ref=sr_1_fkmr1_2?ie=UTF8&qid=1270564714&sr=8-2-fkmr1

    It's the only PHP book Amazon threw up that had someone named 'Gary' in the list of authors. And, also, I find it highly suspect that the most recent edition is missing a particular author:

    http://www.amazon.com/Beginning-Apache-MySQL-Development-Programmer/dp/0764579665/ref=dp_ob_image_bk


    Aside from being about the 10th person to bring up that book, did you ever think not only might "Gary" have been changed from the real name ("Steve"), but PHP could have also been changed (from Perl)?
  • Anon 2010-04-06 12:42
    Anonymous:
    Cygnus:
    One of the worst programmers (though a very nice person) I ever worked with went on to publish several programming books. I thought about purchasing one or more out of curiosity but I didn't want to waste my money. Strange how those who "can't do" seem to think they can teach.

    Those who can, do.
    Those who can't, teach.


    Those that can't teach, sell.
  • D-Coder 2010-04-06 12:52
    All right, I give up. Why "Linear Failure Structure"?
  • Remy Porter 2010-04-06 12:56
    A linear failure structure is a programmer that doesn't understand linear data structures.
  • ObiWayneKenobi 2010-04-06 13:08
    I demand to know real names here. After all, we as developers have an obligation to our fellow programmers to know what books are written by useless hacks.

    So... what's the book he wrote?
  • Crash 2010-04-06 13:17
    Steve H:

    You really think you can only put a variable in an if()?

    You're hardly the person to be commenting on others' code now, are you.

    My words must have confused you. I take full responsibility for your inability to read what I wrote.

    On second thought, I blame your reading comprehension skills.
  • D-Coder 2010-04-06 13:17
    Remy Porter:
    A linear failure structure is a programmer that doesn't understand linear data structures.


    ...wouldn't that be a "linear structure failure"?

    You're just trying to confuse me!!1!
  • Slim 2010-04-06 13:23
  • operagost 2010-04-06 13:24
    Mr H:
    As a PHP developer I can verify that the statement
    echo if (isset($bob +1000)) ;
    not only is pointless but also invalid. If the CWTF(Creator of the WTF) was as gifted in php/perl as he claimed he should have been able to write a driver program to traverse the website directory and copy files to a seperate directory. This assumes that there were no WTFs already in the web site creation (absolute paths, URI references, etc.)

    Perhaps he was working on an embedded computer with no filesystem, typing up code then printing it out, placing the printout on a wooden table, scanning it in, then using Textbridge to OCR the code while riding on a wireless donkey. Brillant!
  • Niraj 2010-04-06 13:26
    Russ:
    Robert:
    I have lost all faith in tech books now


    I was there a LONG time ago. More often than not, books are the result of those who can't do anything else.


    well i wont say it is all bad ... but most of the "learn in 24 hrs", "teach yourself in 30 days", and their ilk are uniformly bad, though i won't be surprised if there are exceptions.

    and boy .. this gary mailer guy does seem to be a bragger kind of chap ... doesn't he ?
  • Niraj 2010-04-06 13:31
    ObiWayneKenobi:
    I demand to know real names here. After all, we as developers have an obligation to our fellow programmers to know what books are written by useless hacks.

    So... what's the book he wrote?


    real name : Rollatomasi
  • LenL 2010-04-06 14:00
    "I can't get my head around arrays."

    In my mind's voice, I read that as "I can't get my head around a raise." Obviously never kept a job (see other messages in this thread) long enough to get a salary increase.
  • Anonymous Coward 2010-04-06 14:22
    Why would you use PHP or Perl on a CD-ROM website?
  • Type O Negative 2010-04-06 14:26
    Nobody:
    ...To many typo's
    Pot, kettle.
  • luis.espinal 2010-04-06 14:30
    Crash:
    Guess who's missing from the the updated version of the book...

    http://www.amazon.com/Beginning-Apache-MySQL-Development-Programmer/dp/0764579665/ref=sr_ob_1?ie=UTF8&s=books&qid=1270562131&sr=1-1


    It's not surprising to see things like this. Garies are everywhere. I met a guy who was hopeless with programming. No hope, and eventually was let go. By some miracle or random chance, he was later working (or posing) as an expert in enterprise architecture. How the hell did that happen is one of those mysteries that are beyond human comprehension.
  • Major Miner 2010-04-06 14:34
    The problem, as usual, is management and their ignorant, bass-ackward direction. When I did a similar project, we developed the CD first. When it was done, I just took one copy, popped it in the optical drive of the web server, and bazinga! web site!

    Yeah, it was a little slow, and fortunately we never took off to the point of having more than one user at a time...
  • toth 2010-04-06 14:35
    Severity One:
    Maybe Steve should have explained to Gary that arrays are like trains of identical cars, or perhaps he should have used the word "choo-choo".



    Except, in the WTF that is PHP, they don't have to be identical cars. You can have a train containing some freight cars, some dining cars, a couple of cabooses, oh, and why not a tugboat or two while you're at it?

    Yeah, yeah, I know, same with any weakly typed language.
  • Chaos Rocks 2010-04-06 14:39
    toth:
    Severity One:
    Maybe Steve should have explained to Gary that arrays are like trains of identical cars, or perhaps he should have used the word "choo-choo".

    Except, in the WTF that is PHP, they don't have to be identical cars. You can have a train containing some freight cars, some dining cars, a couple of cabooses, oh, and why not a tugboat or two while you're at it?

    Yeah, yeah, I know, same with any weakly typed language.

    Call it an "array", people insist you only put boring strict data structures in it. Call it an "object" and now you can load it up with as much crap as you want. It's like relational tables vs. XML. Chaos rocks, baby!
  • the beholder 2010-04-06 14:44
    Steve H:
    You really think you can only put a variable in an if()?
    Of course not, you can also put a parse error like Gary did. There is no law stating you can't. But "you can" doesn't mean it will work; and even if it gets to pass the parser, well... pointless is still pointless.

    You're hardly the person to be commenting on others' comments now, are you.
  • frits 2010-04-06 14:48
    toth:
    Severity One:
    Maybe Steve should have explained to Gary that arrays are like trains of identical cars, or perhaps he should have used the word "choo-choo".



    Except, in the WTF that is PHP, they don't have to be identical cars. You can have a train containing some freight cars, some dining cars, a couple of cabooses, oh, and why not a tugboat or two while you're at it?

    Yeah, yeah, I know, same with any weakly typed language.


    That goes for strongly-typed languages too. In C#/Java you can have and array of Objects, in VB you can have an array of variants, in C/C++ you can have an array of void pointers.
  • Stanley H. Tweedle 2010-04-06 14:55
    Pretty good dissection, Crash, with one small exception...

    Some languages allow reversed condition/statements for various perverse and unnatural reasons. Perl and LISP are two.

    All of these do the same thing in Perl:
    if ( $condition ) { statement; }
    $condition and statement;
    statement if $condition;

    However PHP does not allow this, which suggests that "Gary" probably had exposure to another language and somehow brewed a confused awareness of general syntax!

    Captcha: bene, as in NB: "Nota Bene" means "note well"
  • Crash 2010-04-06 15:01
    Stanley H. Tweedle:
    Pretty good dissection, Crash, with one small exception...

    Some languages allow reversed condition/statements for various perverse and unnatural reasons. Perl and LISP are two...

    Thank you. After seeing a few of the comments pointing this out (I had no idea) I've come to see this a valid syntax for conditionals. As far as I know, and as you pointed out, PHP is not one of these. Somebody should've looked over his shoulder and commented on his code as he wrote it. It seems Gary had the right idea all along!
  • Remy Porter 2010-04-06 15:07
    Stanley H. Tweedle:
    Perl and LISP are two.


    Mmm, I think you're mistaken about LISP. (if) is a function that takes three parameters: the condition, the s-expression to evaluate if true, and the s-expression to evaluate if false.

    LISP does have a "when" and an "unless", however.
    (if (> a 5) b c)
    (when (> a 5) b)
    (unless (> a 5) c)

    //I love LISP because its syntax is so simple.
  • shadowman 2010-04-06 15:13
    Anonymous Coward:
    I wonder if this is the book in question:

    http://www.amazon.com/Beginning-PHP-Apache-MySQL-Development/dp/0764557440/ref=sr_1_fkmr1_2?ie=UTF8&qid=1270564714&sr=8-2-fkmr1

    It's the only PHP book Amazon threw up that had someone named 'Gary' in the list of authors. And, also, I find it highly suspect that the most recent edition is missing a particular author:

    http://www.amazon.com/Beginning-Apache-MySQL-Development-Programmer/dp/0764579665/ref=dp_ob_image_bk


    Hey, great find! After all these posts it's amazing that you were the first person to come up with that.
  • Anonymously Yours 2010-04-06 15:15
    Your Name:
    I find it unbelievable that Gary was that bad of a programmer and nobody noticed.
    I'd inferred pretty much everyone except Steve figured it out from the article.

    Your Name:
    I find it really unbelievable that Steve would hire Gary and not at least check on the quality of his work the first few weeks.
    Why would he think to? Gary was a proactive team player about helping synergize his department's contributions with groupwork. (Sorry, I picture him as someone who uses corpspeak.) To put in more bluntly, Gary beat Steve to the punch by coming to him first, portraying himself as a mentor-savior and reporting how much he's helped everyone (who, by implication, must be inferior).

    Your Name:
    Anyone who claims to be an "expert", though, gets seriously grilled.
    I completely agree with you. However, the article opened with mentioning the "dark side" to Steve's relaxed interview process was that someone of Gary's caliber slipped through.
  • DeepThought 2010-04-06 15:16
    highphilosopher:
    Programmers don't have to use arrays, so the lazy ones won't pick it u.p

    Strangely, I found too many instances where the reverse was true. Too many times I've seen developers using multiple arrays when they should have used a simple map object. Over dependence on arrays can lead to some overly convoluted code. Of course I agree in principle that developers who don't have a sufficient grasp of the language and/or the available API will always create sub-optimal code.

    highphilosopher:
    5-10 years ago a programmer would have said "How can you not know how to do bitwise operations!" yet I find myself explaining it to developers all the time.

    Sadly, I've run into this exact issue too many times to mention.

  • shadowman 2010-04-06 15:17
    Slim:


    And I thought the last guy who posted this was mind-boggling, but there you go and outdo him several hours later. What is this, a one-upmanship contest in posting stupidity?
  • Remy Porter 2010-04-06 15:24
    DeepThought:
    Too many times I've seen developers using multiple arrays when they should have used a simple map object.


    I have a co-worker with an array fetish. He's a big fan of 2D arrays, so we see a lot of code that looks like this:

    lblIDField = arrResults(i,j,10) + arrResults(i,j,15) + ": " + arrResults(i, j, 0)

    //Most of this is in... Classic ASP *shudder*
  • Crash Magnet 2010-04-06 15:37
    Anon:
    Anonymous:
    Cygnus:
    One of the worst programmers (though a very nice person) I ever worked with went on to publish several programming books. I thought about purchasing one or more out of curiosity but I didn't want to waste my money. Strange how those who "can't do" seem to think they can teach.

    Those who can, do.
    Those who can't, teach.


    Those that can't teach, sell.


    Actully, I think the quote is:

    Those who can't teach, adminstraight.
  • WW 2010-04-06 15:57
    Dave:
    I like that he was also photo-shopped out of the cover. Not that they could leave him in there...

    Comparing the covers, yeah, I could have picked Gary just from the picture and the WTF. Something about the way he's leaning forward, and the demented expression.
  • Harrow 2010-04-06 16:02
    Arrays are obsolete. Today they are only used where a file system is not available, such as in embedded systems.

    -Harrow.
  • WhiskeyJack 2010-04-06 16:03
    I thought it was, those who can't teach, teach gym.
  • WebDevHobo 2010-04-06 16:06
    Years later huh?

    Pre-broadband days you say?

    Well, a lot can happen, given enough time.
    It's easy to just sit here and laugh, thinking Gary is still the dumb clutz he was at that time. But him getting fired might have been the spark he needed to take developing more seriously.
  • Some Wonk 2010-04-06 16:19
    Anon:
    Anonymous Coward:
    I wonder if this is the book in question:



    It's the only PHP book Amazon threw up that had someone named 'Gary' in the list of authors. And, also, I find it highly suspect that the most recent edition is missing a particular author:


    Aside from being about the 10th person to bring up that book, did you ever think not only might "Gary" have been changed from the real name ("Steve"), but PHP could have also been changed (from Perl)?

    in completely unrelated news, Gary Mailer's resume has become one of the top searched items on LinkedIn. Who's got the monkey now?
  • Anonymous 2010-04-06 16:42
    WebDevHobo:
    Years later huh?

    Pre-broadband days you say?

    Well, a lot can happen, given enough time.
    It's easy to just sit here and laugh, thinking Gary is still the dumb clutz he was at that time. But him getting fired might have been the spark he needed to take developing more seriously.


    Gary, is that you?
  • Someone 2010-04-06 16:46
    jonsjava:
    Wow. Gotta say, it must be this guy He seems like a crock. Maybe I'm wrong, but doesn't this seem like a spin on the story:

    http://uk.linkedin.com/in/garymailer:

    #
    Analyst Developer
    Aardvark Media

    (Privately Held; 1-10 employees; Internet industry)

    May 2001 — September 2001 (5 months)

    • Identified opportunity and facilitate implementation of improvement of core application for major client.
    • Played a major role in the team that developed an innovative Pan-European Extranet for Siemens Communications.
    • As part of team identified the business and functional requirements.
    • Designed and developed parts of the system that met those requirements within timescale and budget.
    • Facilitated regular project reviews both internally and with client, face to face.
    #
    Analyst Developer
    Motion Pixels

    (Privately Held; 1-10 employees; Information Technology and Services industry)

    August 2000 — February 2001 (7 months)

    • Management of ongoing systems development and enhancement of large client website.
    • Undertook requirement analysis, systems design and implemented solutions, and provided support for new pieces of development. Including black box and user acceptance testing.
    • Identified opportunities for improvements as well as ensuring they were commercially viable.



    For sure....

    Bachelor Science, Majoring in Business Information Technology.

    I scoff at any degree that adds 'Business' to the title....
  • Herby 2010-04-06 16:55
    Yes, quite a few "technical" books are very poor (or worse) quality. Fortunately there ARE some that are very nicely written:
    http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628/ref=sr_1_1?ie=UTF8&s=books&qid=1270587120&sr=1-1
    Unfortunately this is an exception to the rule (*SIGH*). If more books of a technical nature were written as this example, technical libraries would be MUCH smaller due to the consise nature of the content. For now we can only dream.
  • Joseph 2010-04-06 16:59
    Noone able to find an equivalent Steve? Well, that is a coincidence, that a perfectly anonimized (?) name like Gary comes up with such results....
  • blunder 2010-04-06 17:01
    Drew:
    Arrays? Seriously? Can't get your head around arrays?

    Recursion, maybe I could excuse. Certain kinds of trees if you haven't messed with them in a while. But arrays?


    Not knowing recursion is inexcusable. Why the "recursion is ivory tower" thing pops up on here every week (unless I'm being trolled?) just makes me weep. It's first week stuff. That there are even people out there in the profession who are so intellectually lazy to have avoid recursion for years and years explains pretty well why a site like TDWTF exists in the first place.
  • somedudenamedbob 2010-04-06 17:04
    Crash:
    Let's work from left to right to see what's wrong with this simple one-liner. This is narrated in the voice of the PHP while attempting to run the code.

    echo - Okay, we're going to print something to the screen. Got it, we're ready. Let's do this!

    if - Wait, what? 'If' doesn't return anything so how can we echo this? Oh boy.

    isset - alright, so we're inside a conditional apparently. Let's check if this variable is set...that's not a variable, that's an expression! Who let this moron near a computer? Let's try to evaluate the expression anyway. Alright, $bob plus 1000. I really hope $bob is a number of some kind in order for that expression to work. Let's assume it's correct and $bob is, in fact, an integer - we'll pretend $bob = 1. isset(1+1000)...WTF? see below explanation of isset.

    ; (semicolon) - The conditional is done...and we have no instructions to execute after it so it does nothing...this was a waste of time.

    isset is a PHP construct that tests variables to see if they're set to a value. You can pass it multiple variables, each variable as a parameter. You can't pass it an expression or it will vomit up a parse error.

    Captcha: vulputate. Sounds dirty.


    Maybe the poor fool forgot Perl and PHP were actually two distinct languages that are for the most part completely different.

    Gary: But they both use the dollar sign thingy...
  • shocked 2010-04-06 17:10
    O my, I actually worked with the first author listed, after the book was written. I was shocked he had actually helped write a book. He then told me they had asked him to write another on cakePHP, I asked him "oh you know cakePHP?" his answer, "oh no I don't but I'll learn it before starting the book."
  • umm.. 2010-04-06 17:19
    SR:
    SonicLover:
    CAPTCHA: aptent - a tent Gary definitely has not been camping under


    Wanna go camping? There's an app for that.

    I'll get my coat.


    Don't go!
    He's probably this guy.

    captcha: genitus - how appropriate
  • Remy Porter 2010-04-06 17:34
    Joseph:
    Noone able to find an equivalent Steve?


    Pick one.
  • NeXEkho 2010-04-06 17:45
    Haha, you haven't tried reading some of the games design bilge. Awful, incorrect, plagiarist, and often by the makers of the engine.

    Mastering Unreal Technology in particular.

    CAPTCHA: suscipit
  • Chaos Rocks 2010-04-06 17:53
    Remy Porter:
    I love LISP because its syntax is so simple.

    Correction:

    (if (simple (syntax)) (love (I LISP)) agckdie)
  • epsalon 2010-04-06 17:57
    From the book:



    Stupid spam filter thinks my comment is spam! Well, it isn't!
  • Remy Porter 2010-04-06 18:02
    Chaos Rocks:
    (if (simple (syntax)) (love (I LISP)) agckdie)


    No, no. More like this:

    (if (hasProperty simpleSyntax LISP) (iLove LISP) agckdie)

    Seriously, though. LISP has the simplest syntax of any language. It has only one data structure- the list. A list has only one rule- the first element in a list must be a function name. The value of a list is the result of applying the function to the other elements in the list.

    There's obviously a lot more to the language- closures, macros, etc., but the actual syntax is simplicity itself.
  • Tom 2010-04-06 18:10
    Stanley H. Tweedle:

    if ( $condition ) { statement; }

    ...

    However PHP does not allow this...


    if ($value) {
    // Thing to do
    }

    Is perfectly valid in PHP.
  • Chaos Rocks 2010-04-06 18:19
    Remy Porter:
    LISP has the simplest syntax of any language. It has only one data structure- the list.
    Machine language (the only real language; what everything else gets turned into, eventually) has one data structure: the bit.
  • Remy Porter 2010-04-06 18:26
    Chaos Rocks:
    Machine language (the only real language; what everything else gets turned into, eventually) has one data structure: the bit.


    Not really true. It has one syntax element, the op-code, and two data structures- addresses and registers. It's still syntactically simple, but op-codes are far less expressive than s-expressions.

    "Give me an s-expression and a place to run it, and I shall move the Earth." - Lispimedies of Syracuse.

    Addendum (2010-04-06 18:32):
    Chaos Rocks:
    Machine language (the only real language; what everything else gets turned into, eventually) has one data structure: the bit.


    Not really true. It has one syntax element, the op-code, and two data structures- addresses and registers. It's still syntactically simple, but op-codes are far less expressive than s-expressions. And this is all assuming one of the more common architectures.

    And, of course, on a LISP Machine, many LISP operations are executed directly in hardware, obviating the need for machine code entirely. There are similar things for Forth and C.

    "Give me an s-expression and a place to run it, and I shall move the Earth." - Lispimedies of Syracuse.
  • Remy Porter 2010-04-06 18:32
    Wow, so… my edit broke, then. Ignore the first part, read the addendum.
  • Mick 2010-04-06 18:39
    Tom:
    Stanley H. Tweedle:

    if ( $condition ) { statement; }

    ...

    However PHP does not allow this...


    if ($value) {
    // Thing to do
    }

    Is perfectly valid in PHP.


    I think what OP was saying (albeit not so clearly) that the 3 forms were equivalent in perl, however PHP doesn't allow the variations (only the original if)
  • 50% Opacity 2010-04-06 19:14
    Wow, I used to work with a "Gary" as well. Our Gary didn't comment on everybody's code, but he was just as incompetent. He talked his way past management as well, even insisted on a very special keyboard that he needed (which I'm using now, it's actually pretty good). He kept asking the simplest things and never got his head around objects. Apparently at some point he just stopped learning, even commenting sometimes "I don't need to know this." When one of his really simple projects, a simple multi-step sign-up form, bombed completely, he was finally let go.

    Representative lines:


    $id = /* long code to generate id */;
    while (!isUnique($id)) {
    $id = /* long code to generate id */;
    }


    and


    $anArray['a'] = $otherArray['a'];
    $anArray['b'] = $otherArray['b'];
    $anArray['c'] = $otherArray['c'];
    $anArray['d'] = $otherArray['d'];
    … and so on …


    Last I heard he was programming iPhone apps. Which is amazing, since apparently he learned something new. But even the description in the AppStore has apologetic undertones a la "App depends on 3rd party service, if it don't work, me no fault."
  • Kef Schecter 2010-04-06 19:45
    Steve H:
    You really think you can only put a variable in an if()?


    Somebody fails at reading comprehension.

    (Hint: isset() is not 'if'.)

    Remy Porter:
    Seriously, though. LISP has the simplest syntax of any language.


    I see your LISP and raise you Forth. Forth doesn't even need the parentheses! (Imagine an RPN calculator generalized to a complete programming language, and that's basically Forth.)

    Now, if we're only talking about languages that are actually usable by human beings, I'll agree and say that LISP has the simplest syntax. :)
  • Zarggg 2010-04-06 19:58
    "Vulputate" is when you cut off your fox.
  • Cbuttius 2010-04-06 20:19
    jonsjava:
    Wow. Gotta say, it must be this guy He seems like a crock. Maybe I'm wrong, but doesn't this seem like a spin on the story:

    http://uk.linkedin.com/in/garymailer:

    #
    Analyst Developer
    Aardvark Media

    (Privately Held; 1-10 employees; Internet industry)

    May 2001 — September 2001 (5 months)

    • Identified opportunity and facilitate implementation of improvement of core application for major client.
    • Played a major role in the team that developed an innovative Pan-European Extranet for Siemens Communications.
    • As part of team identified the business and functional requirements.
    • Designed and developed parts of the system that met those requirements within timescale and budget.
    • Facilitated regular project reviews both internally and with client, face to face.
    #
    Analyst Developer
    Motion Pixels

    (Privately Held; 1-10 employees; Information Technology and Services industry)

    August 2000 — February 2001 (7 months)

    • Management of ongoing systems development and enhancement of large client website.
    • Undertook requirement analysis, systems design and implemented solutions, and provided support for new pieces of development. Including black box and user acceptance testing.
    • Identified opportunities for improvements as well as ensuring they were commercially viable.


    Strangely enough that guy and myself have a link in common.
  • Remy Porter 2010-04-06 20:19
    Forth is one I haven't played with. I'm working on playing with Haskell in my free time.
  • DH 2010-04-06 20:59
    Remy Porter:
    Forth is one I haven't played with. I'm working on playing with Haskell in my free time.


    Me neither, I got as far as Therd and lost interest....Sekond was pretty cool, though!!
  • pH paper 2010-04-06 21:42
    Anonymous Coward:
    Why would you use PHP or Perl on a CD-ROM website?

    Ding ding ding, we have a winner! This is the real WTF.
  • da Doctah 2010-04-06 22:27
    blunder:
    Drew:
    Arrays? Seriously? Can't get your head around arrays?

    Recursion, maybe I could excuse. Certain kinds of trees if you haven't messed with them in a while. But arrays?


    Not knowing recursion is inexcusable. Why the "recursion is ivory tower" thing pops up on here every week (unless I'm being trolled?) just makes me weep. It's first week stuff. That there are even people out there in the profession who are so intellectually lazy to have avoid recursion for years and years explains pretty well why a site like TDWTF exists in the first place.


    Recursion's inherently hard for some people because it requires you to think inside out.

    Now, concurrent processing, that requires you to think and not think simultaneously.
  • NotDomo 2010-04-06 22:33
    WebDevHobo:
    Years later huh?

    Pre-broadband days you say?

    Well, a lot can happen, given enough time.
    It's easy to just sit here and laugh, thinking Gary is still the dumb clutz he was at that time. But him getting fired might have been the spark he needed to take developing more seriously.


    11 jobs in 10 years looks like one weak "spark" to me...
  • Kai 2010-04-06 23:32
    Disclaimer: I know nothing about PHP.

    On to the point, does PHP have pointers? If it was a pointer, then at least the isset would make sense, right?
  • Kef Schecter 2010-04-06 23:38
    Nope, PHP doesn't have anything like a pointer, just the "assign by reference" semantics that most dynamic languages have.
  • Darius 2010-04-06 23:53
    Anonymous:
    Cygnus:
    One of the worst programmers (though a very nice person) I ever worked with went on to publish several programming books. I thought about purchasing one or more out of curiosity but I didn't want to waste my money. Strange how those who "can't do" seem to think they can teach.

    Those who can, do.
    Those who can't, teach.


    Well, it explains why a lot of books are nothing more than paraphrased Help files. I prefer to spend money buying software to learn first hand, rather than books about the software.
  • Bryan 2010-04-07 00:12
    blunder:
    Drew:
    Arrays? Seriously? Can't get your head around arrays?

    Recursion, maybe I could excuse. Certain kinds of trees if you haven't messed with them in a while. But arrays?


    Not knowing recursion is inexcusable. Why the "recursion is ivory tower" thing pops up on here every week (unless I'm being trolled?) just makes me weep. It's first week stuff. That there are even people out there in the profession who are so intellectually lazy to have avoid recursion for years and years explains pretty well why a site like TDWTF exists in the first place.


    Sadly I understand recursion but can't use it were I work. We use MUMPS which does not handle it well(tends to die).
  • SomeHo 2010-04-07 00:47
    did anyone else misread "homey" as "horny"?
  • sdf 2010-04-07 00:47
    Bryan:
    blunder:
    Drew:
    Arrays? Seriously? Can't get your head around arrays?

    Recursion, maybe I could excuse. Certain kinds of trees if you haven't messed with them in a while. But arrays?


    Not knowing recursion is inexcusable. Why the "recursion is ivory tower" thing pops up on here every week (unless I'm being trolled?) just makes me weep. It's first week stuff. That there are even people out there in the profession who are so intellectually lazy to have avoid recursion for years and years explains pretty well why a site like TDWTF exists in the first place.


    Sadly I understand recursion but can't use it were I work. We use MUMPS which does not handle it well(tends to die).


    Gets the mumps....
  • K 2010-04-07 01:18
    Aww man! You scared him away!
  • Redled 2010-04-07 04:58
    This story is a fake, too big.

    A book about PHP that wouldn't speak about arrays ???

    What's more, the featured PHP statement really looks like one which is invented by an average coder that would think like "what would be the worst possible statement ?"

    I mean, why would Gary have written that ? What would he be trying to do ? Even retarded, even drunk, even the baddest coder ever wouldn't write this. This never happends in real life.

    But now you have 300 comments on ThedailyWTF, here's the glory...
  • iWerner 2010-04-07 05:23
    Redled:
    This story is a fake, too big.

    A book about PHP that wouldn't speak about arrays ???

    What's more, the featured PHP statement really looks like one which is invented by an average coder that would think like "what would be the worst possible statement ?"

    I mean, why would Gary have written that ? What would he be trying to do ? Even retarded, even drunk, even the baddest coder ever wouldn't write this. This never happends in real life.

    But now you have 300 comments on ThedailyWTF, here's the glory...


    You must be new here
  • NSCoder 2010-04-07 05:30
    After reading all these comments on how difficult recursion supposedly is compared with loops and arrays, I suddenly feel so 'smart'... though I used loops in BASIC, when I switched to HyperTalk, for ages I didn't realise loops still existed (I guess I couldn't find 'wend' in the documentation?) and did all looping by recursion. I even had to put in some extra code to avoid the 'too much recursion' errors when I recurso-looped too many times. My only excuse is I was 14 at the time and it was only my second programming language.

    With WTF skills like that, I could have been a star.
  • Cbuttius 2010-04-07 05:53
    jonsjava:
    Forgot to mention: his CV looks like a bad movie sequel, "Fired in 60 Seconds":

    Left after 2 years
    Left after 7 months
    Left after 5 months
    Left after 8 months
    Left after 2 months
    Left after 5 months
    Left after 1 month
    Left after 7 months
    Left after 2 years, 8 months (getting nitpicky now)
    Left after 11 months
    And last, but not least:

    2 years, 7 months
    That makes 11 jobs in 10.9 years.


    This is a very WTF attitude. I have also had a lot of jobs in the last 12 years, back in the late 90s the contract market was like that. There was also a dot-com crash in 2001 and you were lucky to get any work at all. In the mid-2000s a lot of companies were starting to outsource their work out. The decisions are usually made by someone upstairs with regards to head-counts and has nothing whatsoever to do with the person's programming ability at all.

    I also have no reason to believe that this is the same Gary, in fact the person in the real story probably wasn't even called Gary, they change names here...

  • Redled 2010-04-07 06:08
    iWerner:
    You must be new here

    No I'm not.

    Other stories are credible. This one is not.

    With most of other stories, you can tell "Well, I can see how he went wrong", most are about wrong solutions to known problems.

    He it's as credible as a ten-years old child who says "hey, I know a guy who's so stupid that one day, he forgot how to walk"...

    if echo(isset($bob + 1000))... Who can believe this ? I mean, what can be the context ?
  • Anonymous 2010-04-07 06:12
    Cbuttius:
    jonsjava:
    Forgot to mention: his CV looks like a bad movie sequel, "Fired in 60 Seconds":

    Left after 2 years
    Left after 7 months
    Left after 5 months
    Left after 8 months
    Left after 2 months
    Left after 5 months
    Left after 1 month
    Left after 7 months
    Left after 2 years, 8 months (getting nitpicky now)
    Left after 11 months
    And last, but not least:

    2 years, 7 months
    That makes 11 jobs in 10.9 years.


    This is a very WTF attitude. I have also had a lot of jobs in the last 12 years, back in the late 90s the contract market was like that. There was also a dot-com crash in 2001 and you were lucky to get any work at all. In the mid-2000s a lot of companies were starting to outsource their work out. The decisions are usually made by someone upstairs with regards to head-counts and has nothing whatsoever to do with the person's programming ability at all.

    I also have no reason to believe that this is the same Gary, in fact the person in the real story probably wasn't even called Gary, they change names here...

    Utter rubbish, 11 jobs in less than 11 years just reeks of incompentence. I wouldn't dream of even offering this guy an interview.
  • kftt 2010-04-07 06:22
    Remy Porter:
    Joseph:
    Noone able to find an equivalent Steve?


    Pick one.


    Advanced PHP for Flash? Thats like "Get the plague while you still have cancer. And gonorrhea for dessert!"
  • dkf 2010-04-07 06:25
    Remy Porter:
    Seriously, though. LISP has the simplest syntax of any language. It has only one data structure- the list. A list has only one rule- the first element in a list must be a function name. The value of a list is the result of applying the function to the other elements in the list.
    That's oversimplifying. In reasonably modern LISPs there are also several different types of atoms with different syntaxes (e.g., strings) and there's also the array compound type. Moreover, you can't really understand LISP without understanding quote, quasiquote, etc. LISP is only syntactically simple if you ignore the things that make it simple, and gee, so are many other languages if you're allowed to do that...
  • Chopper 2010-04-07 06:55
    Redled:
    iWerner:
    You must be new here

    No I'm not.

    Other stories are credible. This one is not.

    With most of other stories, you can tell "Well, I can see how he went wrong", most are about wrong solutions to known problems.

    He it's as credible as a ten-years old child who says "hey, I know a guy who's so stupid that one day, he forgot how to walk"...

    if echo(isset($bob + 1000))... Who can believe this ? I mean, what can be the context ?


    I kinda see your point, but human stupidity knows no bounds.

    I once worked in a team which hired the self-proclaimed "best Perl programmer in the country". When he had finished his first piece of work, I had the job of reviewing it (review, mind you, this was supposed to be tested code), and the code he handed over was so screwed up that it wouldn't even compile. He was escorted out of the building the next day, still protesting that he was a better programmer than all of us....
  • callcopse 2010-04-07 07:12
    Was it this guy?

    http://en.wikipedia.org/wiki/John_of_Nepomuk

    Inviolability of the confessional is TRWTF
  • Redled 2010-04-07 07:12
    Chopper:
    I kinda see your point, but human stupidity knows no bounds.

    I once worked in a team which hired the self-proclaimed "best Perl programmer in the country". When he had finished his first piece of work, I had the job of reviewing it (review, mind you, this was supposed to be tested code), and the code he handed over was so screwed up that it wouldn't even compile. He was escorted out of the building the next day, still protesting that he was a better programmer than all of us....

    For sure, I've seen some very bad programmers too, in real life, forums, on this site, bad programmers that pretends they're great...

    But here, I cannot even find one single case in which the stupidiest guy on earth could write something like "echo if(isset($bob + 1000));". Please tell me just one case, one weirdest way of thinking.

    Second thing, it would mean that the guy had never launch his code during all those X weeks. Because if he writes this, then he has for sure written such things everywhere in his code. Actually, it would mean that the guy has never written PHP before, simply. Even programming, because he doesn't even know what is an "if" here...

    And when you don't know what is an "if", then you don't know what is an array either.
  • Redled 2010-04-07 07:24
    And yes, human stupidity HAS bounds.
    Sometimes it transcends your imagination, that's all :D
  • Gary 2010-04-07 07:55
    Finaly, now i know who to blame for me being fired ! Rick, i will get my revenge !
  • hometoast 2010-04-07 08:16
    Beginning PHP, Apache, MySQL?
  • Pedants R Us 2010-04-07 08:41
    DH:
    Remy Porter:
    Forth is one I haven't played with. I'm working on playing with Haskell in my free time.


    Me neither, I got as far as Therd and lost interest....Sekond was pretty cool, though!!


    God help us. How can geeks shake their reputation for not knowing how to behave around women if they get to Therd and lose interest. The goal is in sight man!
  • Anonymous 2010-04-07 08:44
    Remy Porter:
    Seriously, though. LISP has the simplest syntax of any language. It has only one data structure- the list. A list has only one rule- the first element in a list must be a function name. The value of a list is the result of applying the function to the other elements in the list.

    LISP fan eh? These must be yours then:

    (((((((((((((((((((((((((((((((((((((((((
    )))))))))))))))))))))))))))))))))))))))))
    (((((((((((((((((((((((((((((((((((((((((
    )))))))))))))))))))))))))))))))))))))))))
  • Remy Porter 2010-04-07 08:46
    Redled:
    if echo(isset($bob + 1000))... Who can believe this ? I mean, what can be the context ?


    That line was copied directly from the submission. I don't know the context either, but having seen similar code in the past, I find it quite plausible.

    kftt:
    Advanced PHP for Flash? Thats like "Get the plague while you still have cancer. And gonorrhea for dessert!"


    *chortle* That pretty much sums up my feeling on PHP and Flash. More the Flash than the PHP.

    dkf:
    That's oversimplifying. In reasonably modern LISPs there are also several different types of atoms with different syntaxes (e.g., strings) and there's also the array compound type. Moreover, you can't really understand LISP without understanding quote, quasiquote, etc. LISP is only syntactically simple if you ignore the things that make it simple, and gee, so are many other languages if you're allowed to do that...


    Strings and arrays aren't really needed in LISP. And quote, quasiquote aren't syntax- they're functions that have an optional syntactic sugar. You could remove the sugar without changing the language.

    But mostly, I love LISP because I secretly love parentheses.
  • Crash 2010-04-07 09:02
    I feel I need to step in and defend PHP and Flash. As a PHP developer by trade I feel it's a great language (sure, strict datatyping - among other things - would probably weed out the crap developers from the good ones but PHP is what it is) that can be picked up easily. What people do with it is a different story. I've seen much WTFery but that says more about the developer than the language.

    Flash gets a bad name because of the horrible use and misuse of it. Flash, too, has its merits and, if done correctly, can be a huge asset to a company or website. A friend of mine works in Flash and can make highly stable, elegant, and organized AS3 interactive elements. My chief arguments against flash were navigation (you couldn't use browser forward/back buttons) and its speed (or lack thereof). He proved me wrong on both counts and showed me that a properly implemented flash movie is much like properly implemented AJAX; highly functional, very elegant, and less linear - more application-like. When Flash is misused, much like JavaScript, it can turn a website into a horrible mess.
  • Bob 2010-04-07 09:58
    There's really only one match on amazon for a PHP book with a Gary as co-author.
  • Redled 2010-04-07 10:15
    Remy Porter:

    That line was copied directly from the submission. I don't know the context either, but having seen similar code in the past, I find it quite plausible.


    In what context have you seen this ?
  • Remy Porter 2010-04-07 10:27
    Redled:

    In what context have you seen this ?


    I've seen complete nonsense code like that in all sorts of projects. A lot of times, it comes back from offshore teams, but I've seen so-called "experts" generate Javascript code that's so nonsensical that I couldn't even guess as to what they were trying to do.

    Seriously, are you trying to say no one has ever handed you code that makes absolutely no sense whatsoever? You obviously haven't handled much of other people's code in that case.
  • Rootbeer 2010-04-07 10:30
    blunder:
    Not knowing recursion is inexcusable. Why the "recursion is ivory tower" thing pops up on here every week (unless I'm being trolled?) just makes me weep. It's first week stuff. That there are even people out there in the profession who are so intellectually lazy to have avoid recursion for years and years explains pretty well why a site like TDWTF exists in the first place.


    Actually, it's common on Embedded Systems to avoid recursive code; there is typically only a small amount of memory available, and there aren't enough spare CPU cycles to do the type of bounds checking necessary to avoid a stack overflow.
  • Remy Porter 2010-04-07 10:39
    Rootbeer:
    Actually, it's common on Embedded Systems to avoid recursive code; there is typically only a small amount of memory available, and there aren't enough spare CPU cycles to do the type of bounds checking necessary to avoid a stack overflow.


    Only if your compiler doesn't do tail call optimization. Which it should.

    //I'm lookin' at you, .NET.
  • Gary 2010-04-07 11:08
    echo if(isset($bob + 1000))

    OK, first of all I work in many languages, so you hacks who only bothered to learn one can't relate.

    I was getting errors pointing to a line that said, essentially, "$fred = $bob + 1000" (I name my variables after my enemies) so I put in a debugging statement. In most sane languages, an "if" in a string context will return "TRUE" or "FALSE" and I wanted to echo that to my screen.

    Just then the boss interrupted me and I never got to try it. Forgot about it and never removed it. Luckily that module never even gets called.

    Was that so hard to understand? Geez, morons.
  • Redled 2010-04-07 11:42
    Remy Porter:
    I've seen complete nonsense code like that in all sorts of projects. A lot of times, it comes back from offshore teams, but I've seen so-called "experts" generate Javascript code that's so nonsensical that I couldn't even guess as to what they were trying to do.

    Seriously, are you trying to say no one has ever handed you code that makes absolutely no sense whatsoever? You obviously haven't handled much of other people's code in that case.

    I have already seen code which I didn't catch the meaning. But I have never seen a code which *had* no meaning.
    If someone wrote it, then it had some sort of meaning for him. Most of the time, weird solutions to imaginary problems.

    Rarely 6 various syntax errors in the same 20 bytes with random keywords and operators in it...
  • frits 2010-04-07 12:27
    Gary:
    echo if(isset($bob + 1000))

    OK, first of all I work in many languages, so you hacks who only bothered to learn one can't relate.

    I was getting errors pointing to a line that said, essentially, "$fred = $bob + 1000" (I name my variables after my enemies) so I put in a debugging statement. In most sane languages, an "if" in a string context will return "TRUE" or "FALSE" and I wanted to echo that to my screen.

    Just then the boss interrupted me and I never got to try it. Forgot about it and never removed it. Luckily that module never even gets called.

    Was that so hard to understand? Geez, morons.


    Really, "Gary"? A branching statement returns a value? Doesn't sound very sane to me.
  • Jay 2010-04-07 12:55
    Anonymous:
    Cygnus:
    One of the worst programmers (though a very nice person) I ever worked with went on to publish several programming books. I thought about purchasing one or more out of curiosity but I didn't want to waste my money. Strange how those who "can't do" seem to think they can teach.

    Those who can, do.
    Those who can't, teach.


    Those who can't teach, become politicians.
  • Jan 2010-04-07 13:05
    My LinkedIn profile looks worse than Gary Mailers. I use it to keep track of my consulting jobs. Poor Gary.
  • somedudenamedbob 2010-04-07 13:48
    Gary:
    echo if(isset($bob + 1000))

    OK, first of all I work in many languages, so you hacks who only bothered to learn one can't relate.

    I was getting errors pointing to a line that said, essentially, "$fred = $bob + 1000" (I name my variables after my enemies) so I put in a debugging statement. In most sane languages, an "if" in a string context will return "TRUE" or "FALSE" and I wanted to echo that to my screen.

    Just then the boss interrupted me and I never got to try it. Forgot about it and never removed it. Luckily that module never even gets called.

    Was that so hard to understand? Geez, morons.


    What language does that work in, Gary?

    Maybe you think you know many languages, when you actually don't. You do know what once you pick one language for one file, you have to stick to that language, right?

    That echo if statement can work in perl, but perl doesn't have echo, it only has print. Then, isset can only accept a variable in PHP, so you can't do isset($bob + 1000). If you did mean it to be in perl, you could have done defined($bob + 1000), which would be allowed in perl but would always return true.
  • Maurits 2010-04-07 14:01
    Chopper:
    I once worked in a team which hired the self-proclaimed "best Perl programmer in the country"... the code he handed over was so screwed up that it wouldn't even compile.


    Naturally, since Perl is an interpreted language.
  • Cbuttius 2010-04-07 17:47
    Anonymous:

    Utter rubbish, 11 jobs in less than 11 years just reeks of incompentence. I wouldn't dream of even offering this guy an interview.


    So "important" you hide behind an alias of "Anonymous" and jump to conclusions like this. Why not try technically testing people? Not that doing even that will define who is likely to work well on a large-scale project. I got 17/20 in a PHP test after just reading a book on it. No way could I call myself a proficient programmer in the language although given time and the manual I could probably come up with something that works adequately.

    I counted the jobs on my CV in the last 10 years and the count also came to 11. 6 month contracts used to be very very common. I've also had 3 jobs in the last year due to them all being WTF jobs... well the last one would have been a great place to work 8 years ago when the development was actually done. In another one, for a well known media company, I was asked by the team-leader to write them a test system with a very loose spec, and the team-leader promptly left and the remainder of the team didn't really know what I was doing, and were surprised it wasn't exactly the way they'd have done it. I also got yelled at by a junior developer there who made himself my senior for daring to write in the documentation that some code was portable.

    Presumably you never came from the "contract" era that was the late 1990s. Subsequently the jobs did get a bit shorter but there has occasionally been the WTF job pop up that just didn't work out. Perhaps read this board a bit more to see the kinds of environments we have had to work under at times.
  • Kef Schecter 2010-04-07 19:56
    Maurits:
    Chopper:
    I once worked in a team which hired the self-proclaimed "best Perl programmer in the country"... the code he handed over was so screwed up that it wouldn't even compile.


    Naturally, since Perl is an interpreted language.


    Yep. It interprets bytecode. And what's the name for a tool that converts source code to bytecode?
  • Charles O. Ward 2010-04-08 01:17
    In case you forgot, Gary's resumé now boasts "15 years experiance in the industry", as well as "prolific author and speaker".
  • suscipere 2010-04-08 04:02
    Remy Porter:
    Strings and arrays aren't really needed in LISP. And quote, quasiquote aren't syntax- they're functions that have an optional syntactic sugar. You could remove the sugar without changing the language.

    Yes, and we could all program in assembly.
    Yet strangely, we do not.

    Remy Porter:
    But mostly, I love LISP because I secretly love parentheses.

    That's pretty much the only reason for loving it in its current (user-visible) syntax..
  • suscipere 2010-04-08 04:04
    Jay:
    Anonymous:
    Cygnus:
    One of the worst programmers (though a very nice person) I ever worked with went on to publish several programming books. I thought about purchasing one or more out of curiosity but I didn't want to waste my money. Strange how those who "can't do" seem to think they can teach.

    Those who can, do.
    Those who can't, teach.


    Those who can't teach, become politicians.

    No, they become priests. Those who fail the morality requirements become politicians.
  • sulu pop 2010-04-08 04:06
    epsalon:
    From the book:



    Stupid spam filter thinks my comment is spam! Well, it isn't!

    It is with that font size. And when using images containing only text.
  • Deavon 2010-04-08 07:01
    Is the guy in question Gary Mailer? from "Beginning PHP, Apache, MySQL Web Development"
  • Anonymous 2010-04-08 07:10
    Cbuttius:
    Anonymous:

    Utter rubbish, 11 jobs in less than 11 years just reeks of incompentence. I wouldn't dream of even offering this guy an interview.

    <snipped a load>

    I still wouldn't offer him an interview and I sure as hell wouldn't lose any sleep over it. The hiring pool is far too rich around here to warrant giving an interview to someone with such a dubious CV. Sorry but keep looking and you'll find something eventually. Something befitting of your lousy CV.
  • DeGustibusNonDisputandumEst 2010-04-08 09:12
    I think vulputate means "to cut off your fox" or something.

  • caper 2010-04-08 13:51
    "A branching statement returns a value? Doesn't sound very sane to me."

    Ruby can. Its cool.
  • wjr 2010-04-08 18:31
    Crash:
    Guess who's missing from the the updated version of the book...

    http://www.amazon.com/Beginning-Apache-MySQL-Development-Programmer/dp/0764579665/ref=sr_ob_1?ie=UTF8&s=books&qid=1270562131&sr=1-1
    The newer newer version has less people on it: http://www.amazon.com/Beginning-PHP-Apache-MySQL-Development/dp/0470391146/ref=sr_1_3?ie=UTF8&s=books&qid=1270765797&sr=1-3-spell
  • DjangoMan 2010-04-09 07:20
    Wow. I remember that PHP book. It sucked... Hard.

    I also know a fail Java guy who has several publications and a fail security chick who has a litany of publications.

    I guess those who can, do, and those who can't co-author crappy books.
  • Mary Galier 2010-04-13 03:49
    suscipere:
    Jay:
    Anonymous:
    Cygnus:
    One of the worst programmers (though a very nice person) I ever worked with went on to publish several programming books. I thought about purchasing one or more out of curiosity but I didn't want to waste my money. Strange how those who "can't do" seem to think they can teach.

    Those who can, do.
    Those who can't, teach.


    Those who can't teach, become politicians.

    No, they become priests. Those who fail the morality requirements become politicians.


    Actually, I think it's the other way around.
  • Redworm 2010-04-15 07:13
    Oooh, I think I might know the real "Gary". I tech-edited a PHP book co-authored by a Big Expert who mostly seemed to go around giving talks at conferences.

    And by tech-edited, I mean re-wrote his chapters and his code. Which were laughable. The Big Expert seemed to have learned some C code once, decided PHP was the more or less the same, and bloviated from there.

    He still got the book credit, though.