• (cs)

    I'm waiting a 4chan style raid against that poor guy

  • Jake (unregistered)

    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?

  • (cs) in reply to Doug
    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 (unregistered)
    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 (unregistered)

    The real Nepomuk

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

  • (cs) in reply to Philipp
    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.

  • (cs) in reply to fw

    NO WONDER THAT PHP BOOK WAS TERRIBLE! It all makes sense now!

  • Anonymous (unregistered)

    Hi there, mystery editor. I like your name.

  • sui (unregistered)

    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 (unregistered) in reply to Crash
    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.

  • (cs) in reply to Crash
    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 (unregistered)

    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 (unregistered) in reply to Crash
    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.

  • (cs) in reply to Steve H
    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 (unregistered) in reply to Cygnus
    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 (unregistered) in reply to Anonymous Coward
    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 (unregistered) in reply to Anonymous
    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.

  • (cs)

    All right, I give up. Why "Linear Failure Structure"?

  • (cs) in reply to D-Coder

    A linear failure structure is a programmer that doesn't understand linear data structures.

  • (cs)

    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 (unregistered) in reply to Steve H
    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.

  • (cs) in reply to Remy Porter
    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 (unregistered)
  • (cs) in reply to Mr H
    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 (unregistered) in reply to Russ
    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 (unregistered) in reply to ObiWayneKenobi
    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 (unregistered)

    "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 (unregistered)

    Why would you use PHP or Perl on a CD-ROM website?

  • Type O Negative (unregistered) in reply to Nobody
    Nobody:
    ...To many typo's
    Pot, kettle.
  • (cs) in reply to Crash
    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 (unregistered)

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

  • (cs) in reply to Severity One
    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 (unregistered) in reply to toth
    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 (unregistered) in reply to Steve H
    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.

  • (cs) in reply to toth
    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 (unregistered) in reply to Crash

    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 (unregistered) in reply to Stanley H. Tweedle
    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!
  • (cs) in reply to Stanley H. Tweedle
    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.

  • (cs) in reply to Anonymous Coward
    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 (unregistered) in reply to Your Name
    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 (unregistered) in reply to highphilosopher
    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.
  • (cs) in reply to Slim
    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?

  • (cs) in reply to DeepThought
    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 (unregistered) in reply to Anon
    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 (unregistered) in reply to Dave
    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 (unregistered)

    Arrays are obsolete. Today they are only used where a file system is not available, such as in embedded systems.

    -Harrow.

  • (cs) in reply to Crash Magnet

    I thought it was, those who can't teach, teach gym.

  • WebDevHobo (unregistered)

    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 (unregistered) in reply to Anon
    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 (unregistered) in reply to WebDevHobo
    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?

Leave a comment on “It's a Linear Failure Structure”

Log In or post as a guest

Replying to comment #:

« Return to Article