• (cs) in reply to FredSaw
    FredSaw:
    Why in god's name would you examine a string to determine gender? Won't boolean do it? Or do they have more than two choices there?

    enum gender { male, female, other }

    It's a TRAP!

  • nt (unregistered)

    It's missing FILE_NOT_FOUND.

  • Iceman (unregistered) in reply to The Outlaw Programmer

    For crying out loud:

    public void addPersion(String name, boolean isMale) {...}

    Please engage brain before commenting!

  • WishCow (unregistered) in reply to Iceman
    Iceman:
    For crying out loud:

    public void addPersion(String name, boolean isMale) {...}

    Please engage brain before commenting!

    That would be male chauvinism!

    Corrected: public void addPerson(String name, boolean isMale, boolean isFemale) { ... }

  • mrt (unregistered)

    A co-worker's code is always full of crap like this:

    UInt8 one = 1; UInt8 zero = 0; stream.write( one, UInt16(0x01) ); stream.write( zero, UInt16(0x01) ); stream.write( zero, UInt16(0x01) )

    or

    String sEmptyPath(""); if( sEmptyPath == sPath )

    And I'm the idiot who needs to patch the shit when he's away for holidays! :P

  • Ben (unregistered) in reply to Grovesy

    Grovesy, that's horribly wrong. You're supposed overlay your answer with bit masks.

    Sorry, but you just failed the interview.

  • (cs) in reply to this can't be true!
    this can't be true!:
    N_NO_decode!!! N_NO_decode! I definitely do not belive it! Show me and I still won't believe it. None of it!

    D_DO_NOT_WANT_decode

  • The Outlaw Programmer (unregistered) in reply to Iceman

    Yeah but client code that uses this method is still ambiguous:

    addPerson("Jaime", true); addPerson("Renee", false);

    You'd have to jump to the source code (if you have it) or read the docs (if there are any). Meanwhile, this is always obvious:

    addPerson("Jaime", Gender.MALE); addPerson("Renee", Gender.FEMALE);

    I think there is an item on this in Effective Java somewhere.

    Iceman:
    For crying out loud:

    public void addPersion(String name, boolean isMale) {...}

    Please engage brain before commenting!

  • (cs) in reply to nt
    nt:
    It's missing FILE_NOT_FOUND.
    I corrected that. See the addendum.
  • (cs) in reply to WishCow
    WishCow:
    Iceman:
    For crying out loud:

    public void addPersion(String name, boolean isMale) {...}

    Please engage brain before commenting!

    That would be male chauvinism!

    Corrected: public void addPerson(String name, boolean isMale, boolean isFemale) { ... }

    So, having been told in parameters[1] whether the subject is male or not, your software still needs to know from parameters[2] whether the subject is female or not? If you get a false for isMale and a false for isFemale then like I said...

    enum gender { male, female, other, fileNotFound }

    I guess we need to add another one in case of both being true:

    shemale

  • tray (unregistered) in reply to KattMan
    KattMan:
    DaveK:
    tray:
    Any chance to turn those "architects" into "expert consultants"?

    Yeh, that's easy. All you need to do to turn them into "expert consultants" is to remove their 1) backbones 2) balls 3) brains.

    Bonus points for using a rusty blunt spoon to do so, of course...

    Double points for using number one to remove 2 and 3. Triple points for realizing that 2 and 3 are one and the same.

    See the following article: http://thedailywtf.com/Articles/Who-is-Kyle-Soze.aspx

  • Admiral Akbar (unregistered) in reply to Zemm
    Zemm:
    FredSaw:
    Why in god's name would you examine a string to determine gender? Won't boolean do it? Or do they have more than two choices there?

    enum gender { male, female, other }

    It's a TRAP!

    I agree. Are you Mon Calamari, too?

  • Bill (unregistered) in reply to Grovesy

    Don't you mean:

    public final static String INT_0 = "0"; public final static String INT_1 = Integer.parseInt(INT_0) + 1; public final static String INT_2 = Integer.parseInt(INT_1) + 1; ...

    ?

    I'm leaving it as an "exercise for the reader" to figure out what to do with the NumberFormatException. ;)

  • (cs) in reply to The Outlaw Programmer
    The Outlaw Programmer:
    Just because something has only 2 states (and will always have only 2 states) doesn't automatically make a 2-state enum a WTF. For example, what if you had a function like:

    public void addPersion(String name, boolean gender) {...}

    If you want to add a woman, do you pass in true or false? Having an enum here makes it immediately obvious which one to use without having to read the docs (if there are any!).

    it is obvious. women are always false.

  • Linus (unregistered)

    I cried when I saw this.

  • Kliment (unregistered) in reply to Andrew
    Andrew:

    Next, a web portal will use vision AI and a webcam to assign gender. Take care of that gynecomastia.

    Amusingly enough, I've seen this sort of thing. Fraunhofer IIS is selling it, in fact. Gave me many amusing minutes while it was trying to guess the gender of the people in the room. Here's the link if anyone is interested:

    http://www.iis.fraunhofer.de/EN/bf/bv/kognitiv/biom/dd.jsp

  • Oskar (unregistered) in reply to Grovesy

    I lol'ed.

  • (cs) in reply to Rick
    Rick:
    Speaking of Architects, I met a woman the other night who met an Architect through a dating service. She was incredulous and angry when she found out that her date didn't make bridges or buildings, but was a 'Network Architect'. I had to explain to her that her date wasn't a liar, just a snob.

    Very funny.

    So, basically, what you're saying is...you're a snob?

Leave a comment on “The Most Thought Out Enumeration ”

Log In or post as a guest

Replying to comment #:

« Return to Article