• cyborg (unregistered) in reply to balazs
    balazs:
    hank:
    LimEJET:
    PHP springs to mind, with this nugget:
    While (true){ how exactly that behavior presents a problem given your basic "value ? false : true" condition like the one we're dealing with here remains a mystery to me. } // unreachable text below this line

    Then again, the original commenter thinks everyone except morons should be manipulating boolean values with bitwise operators, so that kinda calls into question the frame of reference we're dealing with when confronted with words like "moron" and "messed up".

    I just can't read any further, pls. someone interrupt me

    I'd love to but unfortunately this code is not threaded. I'll have to pull the plug.

  • The pig (unregistered) in reply to Dschoordsch

    Well - some sides are more equal than other sides.

  • Mike (unregistered) in reply to Kata

    Genius :)

  • Davor (unregistered) in reply to trololo
    trololo:
    "... I’d love to explain the basics to you, but I really need to get this feature finished."

    And so I finished the new feature :

    Switch(showOptionsButton){ case (true): showOptionsButton = false; case (false): showOptionsButton = true; default: showOptionsButton = if(rand()%2); }

    Oooh, no breaks, this one is of a sneakiness I much appreciate. :)

  • (cs)

    Wow. That's fucking awful. Reminds me of the time we had an Active Directory specialist guest in a dev project of ours: all we needed was a few LDAP methods for creating, deleting, finding and modifying users writing in a class. Or so we thought.

    The morning hadn't even finished and he'd declared that referencing .dlls in .net was not just bad practice, but also totally impossible to achieve. He then said we had to reassemble a nicely UML'd solution with 12 projects into one standalone console .exe project, or he could never see it working.

    I spent the entire afternoon with him stepping through code that went from one assembly to another one, to prove to him it could be done so he would actually start doing some work for us. He grudgingly accepted but not before he'd loudly criticised the entire dev team working on the application to the management for over-engineering, making stuff too complicated for HIM and undermining HIS role on the project. The little fucking diva. Then he deleted all the setup projects and rolled his own with a batch file.

    You can only imagine how the next day went when I introduced him to the concept of unit testing. Fuck me. Linq next.

    In over a decade I've never met a more obnoxious, more know-it-all, less teamworking little cunt than him. A few have come close, but they've had some sort of saving grace at least.

  • wim (unregistered) in reply to Kev

    Maybe the senior developer was a Verilog programmer at heart. Was he fond of the 'register' keyword?

  • Hank (unregistered) in reply to Kata

    LOL! I have had a "mentor" or two just like that...

  • Norman Diamond (unregistered) in reply to Davor
    Davor:
    trololo:
    "... I’d love to explain the basics to you, but I really need to get this feature finished."

    And so I finished the new feature :

    Switch(showOptionsButton){ case (true): showOptionsButton = false; case (false): showOptionsButton = true; default: showOptionsButton = if(rand()%2); }

    Oooh, no breaks, this one is of a sneakiness I much appreciate. :)
    "... I’d love to explain the basics to you ..."

    No need. The basics come pre-broken.

  • Norman Diamond (unregistered) in reply to Norman Diamond
    Norman Diamond:
    Davor:
    trololo:
    "... I’d love to explain the basics to you, but I really need to get this feature finished."

    And so I finished the new feature :

    Switch(showOptionsButton){ case (true): showOptionsButton = false; case (false): showOptionsButton = true; default: showOptionsButton = if(rand()%2); }

    Oooh, no breaks, this one is of a sneakiness I much appreciate. :)
    "... I’d love to explain the basics to you ..."

    No need. The basics come pre-broken.

    Oops. Belatedly I C what you did there.

  • (cs)

    just got my new interview question.

  • farico (unregistered)

    this is totally intredasting! Is Ben still working there?

  • The Irritainer (unregistered)

    the comments here are way more amusing as the article... :D

  • Joeuser (unregistered)
    x ^= true

    is so much cleaner

  • El Guaco (unregistered)

    A unit test would have proved the code was faulty.

  • CA (unregistered)

    This is so stupid I have a hard time believing it. Perhaps the "mentor" is a university student one or two years senior to our protagonist? I cannot think of any programmer being unable to understand basic concepts as if-else. Also, making a test would be very very simple and make that idiot STFU. Was the argument something more complex and Remy simplified it?

  • (cs) in reply to Paul Neumann
    Paul Neumann:
    Medinoc:
    Visual Basic .Net has it implemented as a function. A non-generic function, that takes one Boolean and two Object as arguments and returns Object (plus, the fact that both sides are evaluated in both cases, but that one is inevitable when using functions).
    Fun with VB.NET's if operator and functions:
    Dim myVar = IIf(Test As Boolean, IfTrue As Object, IfFalse As Object)
    Is a function which will evaluate both the truthy and non-truthy argumentsdespite the value of Test.
    Dim myVar = If(Test As Boolean, IfTrue As T, IfFalse As T)
    Is an operator which will NOT evaluate both IfTrue and IfFalse. The only difference is the extra I in the function name.

    For bonus points:

    Dim myVar = If(Test As Nullable(Of T), IfNull As T)
    Will return the value of Test if it is not null, otherwise it will return the value of IfNull.

    If the If is not the part of an evaluation or assignment the code is invalid and will not compile. IIf does not need to be a part of an evaluation or assignment. See also: http://ideone.com/e81FvE

    Ooh, thanks for this useful info, I actually didn't know. I guess that's what happens when you have to teach yourself VB at work rather than actually learn VB from a book/tutorial.

  • Norman Diamond (unregistered) in reply to CA
    CA:
    I cannot think of any programmer being unable to understand basic concepts as if-else.
    Well, that just shows how inexperienced you are. Eventually you'll find lots of professional programmers just like that, where professional means getting paid for it and doesn't mean having any understanding of it. Then you'll find that those are the same people who get promoted to management, overseeing us silly fools who are stupid enough to do real programming. Next you'll find a web site with lots of discussions about it.
  • Kell S (unregistered) in reply to Kata

    Sorry, not valid brainfuck code.

  • Kell S (unregistered) in reply to Kata
    Kata:
    =! != != !

    Sorry, not valid brainfuck code.

  • owq (unregistered)

    I don't believe this!!!

  • Joan (unregistered) in reply to Kata

    SENIOR? even more... DEVELOPER? .. jeez!

  • instigator (unregistered) in reply to RandomGuy
    RandomGuy:
    Btw: Did you know of the "converges to" operator in C/C++:
      int x=10;
      while(x --> 0) {
        printf("%d\n",x);
      }
    Neat trick! I can't wait to use that!
  • (cs) in reply to tin

    //Better

    if (isFrist(posts.front())) { posts.pop_front(); }

    while(isFrist(posts.front())) { posts.front().source().sendMessage("You are an idiot."); posts.pop_front(); }

  • (cs) in reply to Kell S
    Kell S:
    Kata:
    =! != != !

    Sorry, not valid brainfuck code.

    Actually a perfectly valid empty program ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++.---.

  • Maarten (unregistered) in reply to Kata

    :-) != :) != :-( → :( !

  • RobertBug (unregistered)
    Comment held for moderation.

Leave a comment on “The Truth of the Matter”

Log In or post as a guest

Replying to comment #:

« Return to Article