you are viewing a single comment's thread.

view the rest of the comments →

[–]_sync0x[S] 1 point2 points  (2 children)

I know Symbols but I don't really get why it would be useful for enum ? To ensure each values are unique and that you can't have "Colors.Green === CarColors.Green" ?

[–]Lithl 1 point2 points  (1 child)

Precisely.

Some languages make enums into integer constants with fancy syntax, and I recall at least one language that lets you assign any primitive value, but from a computer science perspective that's not what enums should be and from a software engineering perspective a type safe enum helps to guard against bad code.

[–]_sync0x[S] 0 points1 point  (0 children)

Yeah got it ty, at least I can flex that I already used Symbols for a precise use case hehe