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?

  • pm_me_your_quackers@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    To add, turning everything into an enum can make the code nearly unreadable and hard to work with. This isn’t Rust, and there’s no performance gain for using enums over string unions.