logoalt Hacker News

spacechild1yesterday at 7:38 PM1 replyview on HN

> But if given the choice, I'd choose the C-macro implementation (which is 30+ years old) over this, every time.

Why? The implementation is not pretty, but you only need to write it once and then it works for all enums. The actual usage is trivial, it's just a function call.

The C macro version is horrendous in comparison. Why would I want to declare my enums like that just because I might want to print them?


Replies

madducitoday at 5:28 AM

Then why isn't part of the stdlib? Why should everybody maintain their own version?

show 1 reply