• Norman Diamond (unregistered) in reply to Neal Blomfield
    Neal Blomfield:
    Neal Blomfield:
    Depending on the language, rolling your own enums using classes is actually better than using enums as you can add behaviour to class based enums but you can't add behaviour to enum based enums (at least in c# you can't). If you start with a class based enum it takes a lot more work to replace it later when you want to add behaviours.
    ... If you start with *enum-based* enums ...
    Yeah well, how do you know if you enumerated all the kinds of enums?
  • (cs) in reply to Doctor_of_Ineptitude
    Doctor_of_Ineptitude:
    Alex seems to be missing in action, and his minions seem happy to burn the place down.
    Most of the minions are not particularly fond of Discurse, either. Just like the rest of us, they are stuck with what Alex picked.
    Doctor_of_Ineptitude:
    Discourse has features that don't matter, and fails miserable at it's basic task, making comments readable and enabling a conversation.
    One of Discurse's basic tasks, according to Jeff Atwood, one in which it does succeed, is forcing users to register to read or comment. Anonymous comments are bad, and should never be allowed anywhere. Period. Even if the community has successfully allowed anonymous comments for years. They must be eliminated at all costs, even the cost of driving away 90% of your readers. Forcing users to log in to read is also good, because if you're already logged in, there is no barrier to participating the conversation. So says The Atwood; so must it be.
    Doctor_of_Ineptitude:
    This is a WTF of epic proportions right at thedailywtf.
    Yep.
  • (cs) in reply to HardwareGeek
    HardwareGeek:
    One of Discurse's basic tasks, according to Jeff Atwood, one in which it does succeed, is forcing users to register to read or comment. Anonymous comments are bad, and should never be allowed anywhere. Period. Even if the community has successfully allowed anonymous comments for years. They must be eliminated at all costs, even the cost of driving away 90% of your readers. Forcing users to log in to read is also good, because if you're already logged in, there is no barrier to participating the conversation. So says The Atwood; so must it be.

    The funny thing is that one of his favorite books says the exact opposite.

  • xinthliss (unregistered) in reply to Nagesh

    Yes, and they had to do it barefoot, in the snow, going uphill both ways.

  • Norman Diamond (unregistered) in reply to HardwareGeek
    HardwareGeek:
    One of Discurse's basic tasks, according to Jeff Atwood, one in which it does succeed, is forcing users to register to read or comment.
    50% success is success?

    Discourse makes it hard to read comments, but that's because of Discourse, not because of not registering.

    HardwareGeek:
    Anonymous comments are bad,
    What the fuck difference would it make? The spammers who advertise stolen credit cards are registered.
    HardwareGeek:
    Forcing users to log in to read is also good,
    Fine, let 90% of your readers find other sites. But why stop there? Why not let 100% of your readers find other sites?

    Volunteers are volunteers, I can't complain if this site 90% goes away or 100% goes away, I only genuinely wonder why you wish to do it.

  • (cs) in reply to Norman Diamond

    Has that discourse nonsense stopped yet? Can I come out of the closet?

  • Jibble (unregistered) in reply to Anonymoose
    Anonymoose:
    These are cool. They can work as enums, but you can also add more properties to it, so you can basically have a coding identifier, a numerical ID, and a string. Like { BOOL_FILENOTFOUND, 666, "File not found! Crikey!" }

    Can't those "properties" be stored as XML in a database?

  • Anonymoose (unregistered) in reply to Jibble
    Jibble:
    Anonymoose:
    These are cool. They can work as enums, but you can also add more properties to it, so you can basically have a coding identifier, a numerical ID, and a string. Like { BOOL_FILENOTFOUND, 666, "File not found! Crikey!" }

    Can't those "properties" be stored as XML in a database?

    Not everything has to be in a database. What, you're going to roll out SQLite (at best) if you're making a console app to read a file? No sir, you are going to have a function to internally return BOOL_FILENOTFOUND if there's no file, you'll return 666 to the OS as the exit code, and you're going to print out "File not found!". (Granted, you'll get in trouble if you require i18n, but you probably aren't going to require it.)

    Custom enums are fine. No need to overcomplicate things if not absolutely necessary.

  • abigo (unregistered) in reply to D-Coder
    D-Coder:
    So to use Haskell, I need to understand adjuntions, monads, and... Kliesli algebra?
    No, of course not, just like you can use GPS without understanding the physics and mathematics behind it. The good Captain is simply showing off.
  • Your Name (unregistered) in reply to ratchet freak
    ratchet freak:
    Eric:
    It's called the type safe enum design pattern, and it does have its uses. They're rare, but they do exist. Captcha was enim. :)

    type safe? in java enums are their own class unlike in other C style languages where they are int constants

    C++11 has type-safe enums now.

    C++11: The Features Every Other Programming Language Had Fifteen Years Ago, Today!

  • (cs) in reply to Norman Diamond
    Norman Diamond:
    Discourse makes it hard to read comments, but that's because of Discourse, not because of not registering.
    Agreed. Registering makes it slightly less difficult, as it makes it easy to keep track of where you left off reading. Sort of.
    Norman Diamond:
    HardwareGeek:
    Anonymous comments are bad,
    What the fuck difference would it make? The spammers who advertise stolen credit cards are registered. ... I can't complain if this site 90% goes away or 100% goes away, I only genuinely wonder why you wish to do it.
    I was mocking what The Great Atwood said, not agreeing with it. I certainly don't want any (well, except for two or three) of the users to go away.
  • (cs) in reply to Nagesh
    Nagesh:
    The Great Lobachevsky:
    snoofle:
    Please stop using discourse! How else can I impersonate snoofle in order to say something he'd thought is witty if he were Me?

    My employer only supplies IE8, so I can't even read the comments when Discourse is in use.

    Haven't you heard of USB sticks and Portable Apps?

    I'm not allowed to attach any USB devices to my computer.

  • (cs) in reply to Steve
    Steve:
    The Great Lobachevsky:
    My employer only supplies IE8, so I can't even read the comments when Discourse is in use.

    The WTF is why you still work for them.

    Because they actually pay the software developers OT. :)

  • Anon (unregistered) in reply to G. Applqst

    exactly the point i was going to make :) not something i would (or have) used a lot, but could be the intention

  • Cheong (unregistered) in reply to Nagesh
    Nagesh:
    The Great Lobachevsky:
    snoofle:
    Please stop using discourse! How else can I impersonate snoofle in order to say something he'd thought is witty if he were Me?

    My employer only supplies IE8, so I can't even read the comments when Discourse is in use.

    Haven't you heard of USB sticks and Portable Apps?
    Plugging unauthorized flash drive in and/or running unauthorized software at company's computer can lead to termination of employment.

    News at 11.

  • Anonymouse (unregistered) in reply to snoofle

    "Please stop using discourse!" Seconded

  • Worf (unregistered)

    Another vote for abandoning discourse.

    If nothing else, the fact the discussion page and article page are no longer attached is annoying - why can't I see both inline like it is now?

  • Eff Five (unregistered)

    Honestly I don't like the name Enumeration since it can lead to confusion. Also it's not clear from what's written why they opted to use this pattern.

    That said there are framework enumerations like StringComparer that can serve as examples where there's a thing that looks like an enumeration but isn't and there are good reasons behind it.

  • tp (unregistered) in reply to D-Coder

    So to use Haskell, I need to understand adjuntions,

    There is excellent book called "Category Theory" by Awodey, which explains everything about adjunctions.

  • Developer Dude (unregistered) in reply to ratchet freak

    Enums are in Java now, but there is a lot of legacy code out there written before Java had enums.

  • Developer Dude (unregistered)

    "They had rolled their own enum. Try as he might, Nathan could not even begin to point out the number of things wrong with this."

    You missed a chance for a pun. Here, I will fix it for you:

    "They had rolled their own enum. Try as he might, Nathan could not even begin to enumerate the number of things wrong with this."

  • Seppl (unregistered) in reply to Neal Blomfield

    There's (almost) nothing you can't accomplish using custom attributes and extension methods.

Leave a comment on “Rolling Your Own”

Log In or post as a guest

Replying to comment #:

« Return to Article