• (cs) in reply to sadwings
    sadwings:
    If it was easier to change the macro definition instead of combining them into one and changing all of the calls, then there's your reason for doing so.
    At least a search-and-replace on "Diederick" ought not to have too many false positives.
  • BadFellas.org (unregistered) in reply to JavaJaap
    JavaJaap:
    deekay:
    Hans niet goedkeuren van deze stomme code!

    What crappy translator did you use?

    But what bothers me most is that I can't come up with a famous Dutch song or book or movie that has four characters named Jan, Kees, Piet and Diederick.... Jan and Piet share a song with Joris and Corneel, but these other guys are nowhere to be found in this WTF....

    Might have been coworkers at the company. Although, what are the chances of finding a Jan and a Kees and a Piet nowadays?

  • Anonymous (unregistered) in reply to AndyCanfield
    AndyCanfield:
    Sometimes when I'm in the mood I name my variables after my ex-girlfriends. Haven't run out yet.
    We look forward to seeing your code here.
  • Robert Scholte (unregistered) in reply to $$$
    $$$:
    JavaJaap:
    deekay:
    Hans niet goedkeuren van deze stomme code!

    What crappy translator did you use?

    But what bothers me most is that I can't come up with a famous Dutch song or book or movie that has four characters named Jan, Kees, Piet and Diederick.... Jan and Piet share a song with Joris and Corneel, but these other guys are nowhere to be found in this WTF....

    I'm guessing this is a Government System?: http://en.wikipedia.org/wiki/Jan_Kees_de_Jager http://en.wikipedia.org/wiki/Piet_Hein_Donner http://en.wikipedia.org/wiki/Jan_Peter_Balkenende Piety we can't find Diedrick, though, maybe he retired already....

    Yes, there is: http://en.wikipedia.org/wiki/Diederik_Samsom

  • Peter (unregistered) in reply to deekay
    deekay:
    gravis (useless old sound card)
    You take that back, right now... gravis ultrasound was ahead of its time.

    captcha: minim

  • Lee K-T (unregistered) in reply to Robert Scholte
    Robert Scholte:
    $$$:
    JavaJaap:
    deekay:
    Hans niet goedkeuren van deze stomme code!

    What crappy translator did you use?

    But what bothers me most is that I can't come up with a famous Dutch song or book or movie that has four characters named Jan, Kees, Piet and Diederick.... Jan and Piet share a song with Joris and Corneel, but these other guys are nowhere to be found in this WTF....

    I'm guessing this is a Government System?: http://en.wikipedia.org/wiki/Jan_Kees_de_Jager http://en.wikipedia.org/wiki/Piet_Hein_Donner http://en.wikipedia.org/wiki/Jan_Peter_Balkenende Piety we can't find Diedrick, though, maybe he retired already....

    Yes, there is: http://en.wikipedia.org/wiki/Diederik_Samsom

    Everybody know who's Piett!!!!! The Executor! The battle of Endor!

    http://starwars.wikia.com/wiki/Firmus_Piett

    which means the others might be:

    http://starwars.wikia.com/wiki/Jan_(stormtrooper) http://starwars.wikia.com/wiki/Bhydee_Kees

  • (cs) in reply to Robert Scholte
    Robert Scholte:
    $$$:
    JavaJaap:
    deekay:
    Hans niet goedkeuren van deze stomme code!

    What crappy translator did you use?

    But what bothers me most is that I can't come up with a famous Dutch song or book or movie that has four characters named Jan, Kees, Piet and Diederick.... Jan and Piet share a song with Joris and Corneel, but these other guys are nowhere to be found in this WTF....

    I'm guessing this is a Government System?: http://en.wikipedia.org/wiki/Jan_Kees_de_Jager http://en.wikipedia.org/wiki/Piet_Hein_Donner http://en.wikipedia.org/wiki/Jan_Peter_Balkenende Piety we can't find Diedrick, though, maybe he retired already....

    Yes, there is: http://en.wikipedia.org/wiki/Diederik_Samsom

    Or http://nl.wikipedia.org/wiki/Diederik_van_Vleuten (sorry, no English wiki page: he's a comedian)! In that case the mistery is solved: he's impersonating the other two!

    BadFellas.org:
    Although, what are the chances of finding a Jan and a Kees and a Piet nowadays?

    Well actually.... Piet is one desk next to me, Jan's are flying around all over the place, but no Kees indeed.

  • (cs) in reply to tgape
    tgape:
    toth:
    Mike:
    toth:
    Lupus.Umbrae:
    toth:
    Wait..."0" means "true"? I think that may be TRWTF.

    When that is a WTF then strcmp() is a WTF, too...

    strcmp() doesn't return a boolean...

    C doesn't have booleans. It uses ints where 0 is false and any value that isn't 0 is true. That means strcmp will return "false" when the strings are equal and "true" when they are not.

    I know. C's "booleans" aren't really booleans. But nevertheless, strcmp() returns an integer type result, not a boolean type result (even though there IS no "boolean" per se). Since it has three possible results, it cannot possibly be considered a boolean.

    And nor should it--strcmp() isn't "asking a question", so to speak. Does it make sense to say "Compare these two things. Yes or no?"? No, it doesn't. That's essentially what strcmp() is doing.

    I'm pretty sure I've seen at least one C library where strcmp was implemented as returning the int (s1[idx_first_difference] - s2[idx_first_difference]), treating the characters as unsigned. This definitely returned a lot more than 3 results.

    That having been said, I've seen dozens of people other than me who've used its results as a boolean.

    Note that the primary justification I've seen for the Unix truth values (where 0 is true and everything else is false) is that there are generally a lot more ways things can go wrong than there are that they can go right.

    Note that I am a Perl programmer, at least partially because I believe everything should be a boolean, in addition to any other properties it may have.

    Okay, point taken. But at any rate, a boolean, by definition, has one of two possible values. Any more than that, and it's not a boolean. Of course you can use it as a boolean, but that doesn't really make it a boolean return type any more than indexOf() has a boolean return type.

  • dag (unregistered) in reply to tgape
    tgape:
    Note that the primary justification I've seen for the Unix truth values (where 0 is true and everything else is false) is that there are generally a lot more ways things can go wrong than there are that they can go right.

    I suppose with the 'Unix truth values' you mean the return values for Unix system calls. They have absolutely nothing to do with true or false. They simply define -1 as an error (errno has the actual error number) and anything else (>= 0) as a successful return value.

  • (cs) in reply to Not always wrong
    Not always wrong:
    toth:
    Wait..."0" means "true"? I think that may be TRWTF.
    There's only one way for a comparison to be true, but it can be false in many ways.

    Ever had a function that returns Zero when it succeeded? int Main() for example?

    But that's not a boolean, that's an error code.

  • jugis (unregistered) in reply to dag
    dag:
    tgape:
    Note that the primary justification I've seen for the Unix truth values (where 0 is true and everything else is false) is that there are generally a lot more ways things can go wrong than there are that they can go right.

    I suppose with the 'Unix truth values' you mean the return values for Unix system calls. They have absolutely nothing to do with true or false. They simply define -1 as an error (errno has the actual error number) and anything else (>= 0) as a successful return value.

    Im pretty sure that there are unix systems that define anything but 0 as an error code. Seen plenty of them around.

  • (cs) in reply to toth

    Replace "needle" with "cock" in this story, and it would be pretty funny. Without that, however... yawn.

  • jay (unregistered) in reply to Not always wrong
    Not always wrong:
    There's only one way for a comparison to be true, but it can be false in many ways.

    Only one truth? Apparently you haven't caught on to the modern spirit of Tolerance and Relativism.

  • jay (unregistered) in reply to AndyCanfield
    AndyCanfield:
    Sometimes when I'm in the mood I name my variables after my ex-girlfriends. Haven't run out yet.

    I like to name files after my ex-wife. That way I can drag her, drop her, and stuff her in the recycle bin.

  • Worf (unregistered) in reply to tgape
    tgape:
    I'm pretty sure I've seen at least one C library where strcmp was implemented as returning the int (s1[idx_first_difference] - s2[idx_first_difference]), treating the characters as unsigned. This definitely returned a lot more than 3 results.

    That having been said, I've seen dozens of people other than me who've used its results as a boolean.

    strcmp() has only three return values. Less than zero, zero, and greater than zero. (This applies to many other functions, as well). The actual value returned, other than zero, has no meaning and is arbitrary. The library may calculate the difference that way, return -1/0/1, minimum/0/maximum, whatever it wants. What it returns is meaningless (other than zero).

    As for treating the return of strcmp() as a true-false, that's because strcmp() returns 0 if the strings are identical. Having it return 0 means the !strcmp() gets you the answer "are the strings identical?". which is a common question. But if you were sorting the strings and doing the compare, well, you'd use strcmp() as well, because it tells you which one is less than the other.

  • (cs) in reply to kastein
    kastein:
    what the...

    WHY are three of them exactly the same? This code is just plain twisted no matter how I look at it; at least they had the decency to surround the macros with parentheses to avoid unexpected side effects.

    ... it's the four dutchmen of the codepocalypse

    <sarcasm> Welcome to The Daily What The Fuck - kastein. You will find the use of the term "WTF" commonly coming from your fingers and lips as you peruse the fantastic and wondrous articles contained within these dark and sumptuous premises. </sarcasm>
  • Drak (unregistered)

    Perhaps he meant Cees instead of Kees (seeing as it is pronounced the same way). In this case it could be Cees Vermeer, Diederick Grobbee, Jan Janzen and Piet Geusens, who all seem to have profiles on BiomedExperts.com

    (Google for 'piet diederick jan cees' (without the quotes, on the US version of google), see the 3rd result.

  • food (unregistered) in reply to Merty

    Back when I was starting out (early 90's), I actually had a project manager that insisted on this - he wanted code named by those responsible for it. Thought it was a brilliant accountability move.

    Of course, each of the obvious things you can think of happened, and the code just kept getting better. Inline comments saying, "Bob here, fixing a bug in Joe's object". Joe's object, in turn, was really named for Mary, who quit earlier.

    This was the same PM who refused us a bug tracker, because he didn't want to waste precious programmer time on "wasteful make-work overhead".

    Pure brilliance. I wonder what that schmuck does for a living now.

  • (cs) in reply to Merty

    日,不懂你讲什么的?

  • CoyneT (unregistered) in reply to GalacticCowboy
    GalacticCowboy:
    This is clearly better than my practice of naming all inline functions "Alex", "Jake" and "Mark"...

    And far better than my Al, Bo, Cy, Di, Em, and etc.

  • CoyneT (unregistered) in reply to Dan Covill
    Dan Covill:
    The year: 1961 We were building a large system for a new Air Force contract. Being short-handed, we subbed a test analysis tool to another division of our company, which needed work.

    When it arrived, we glanced at the code. Like the Dutchmen, the programmer had made all the procedures names - Eric, Charley, Darlene, Shirley, ... But she went one step further. The arrays (all global, of course) were named Gin, Whiskey, Vodka, Rum, ....

    Dan Covill San Diego

    Oooooo ... namespaces!

  • (cs)

    who can tell me this website is mainly for what ?

  • haero (unregistered) in reply to Synchronos
    Synchronos:
    Merty:
    Poor programmer don't know what kind of errors there are and what to do with it and ask 4 people: Kees, Jan, Piet and Diederick. All came with a different solution.

    And the next "Tales from Interview" article is born: You are walking along a mountain trail and come across a fork with four Dutchmen. You don't know where to head and you know only one of them talks a truth. What do you do?

    Use macros!

  • vindico (unregistered) in reply to Dan Covill
    Dan Covill:
    The year: 1961 We were building a large system for a new Air Force contract. Being short-handed, we subbed a test analysis tool to another division of our company, which needed work.

    When it arrived, we glanced at the code. Like the Dutchmen, the programmer had made all the procedures names - Eric, Charley, Darlene, Shirley, ... But she went one step further. The arrays (all global, of course) were named Gin, Whiskey, Vodka, Rum, ....

    I'm curious whether the relationships between procedures and arrays correlated with her bar room behaviour.

  • Freud (unregistered)

    Reason and lust can't be opposite forever.

  • Mark (unregistered) in reply to GalacticCowboy
    GalacticCowboy:
    This is clearly better than my practice of naming all inline functions "Alex", "Jake" and "Mark"...

    You named an inline function after me? I'm honored.

  • PersonWhoHasToUseThisProgram (unregistered)

    No wonder we go through so many Gas injection system needles. FFS. There are few manufacturers of these.

Leave a comment on “The Four Dutchmen”

Log In or post as a guest

Replying to comment #:

« Return to Article