this post was submitted on 09 Sep 2026
73 points (84.8% liked)

Programmer Humor

33153 readers
474 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] RustyNova@lemmy.world 3 points 1 hour ago

Never said that. In fact, enums have lots of issues that can add a lot of boilerplate code.

But actually having data associated with the type system instead of just a flag is a lot more powerful and less prone to errors than classic enums

You can also put functions on this union type that allows easy abstraction of what state the union is in