3 ms·
Both are valid depending on what you're modelling. As far as programming languages go, all enums are explicitly open-ended in C, C++, and C#, at least, because
by int_19h 2y ago
Both are valid depending on what you're modelling.
As far as programming languages go, all enums are explicitly open-ended in C, C++, and C#, at least, because casting an integer (of the underlying type) to enum is a valid operation.
- jay_kyburz 2y agoMy pet hate is when folks start doing math on enums or assuming ranges of values within an enum have meaning.
- DonHopkins 2y agoLike pesky Hex<=>Decimal conversion with the gap between the numbers and the letters, and upper/lower case letters too.
- eru 2y agoYeah, C, C++ (and C#) aren't very good at modelling data structures.