I have googled this and even got to the second page, and there does not seem to be any kind of consensus.

As far as I can tell, it’s a bad idea because it creates code you don’t see and accepts inputs that you wouldn’t want. And yet, many people seem to like them more than, say, const unions due to being easier to refactor in bulk.

So what gives? Is this a case of IT people having very strong opinions on stuff that doesn’t matter? Or is there a technical reason for or against it?

  • Aux@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    Use enums when you need enums. Don’t use them when you don’t need them. What’s the issue?

    • fidodo@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      8 months ago

      You probably don’t ever need enums since the const keyword was added after enums and const objects handle enum use cases unions don’t.

      • Aux@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        You mean const assertions. Well, the thing is that const assertions are not enums. They don’t handle enum use cases in any way.