Hacker News new | ask | show | jobs
by mmaniac 450 days ago
What's so bad about _Generic?

I would not let the name distract you - it's equivalent to overloading, not "generics" (i.e. parametric polymorphism)

In that capacity I think it's quite a lot more sane than C++. Having a closed set of overloads, not having name mangling, not having complex name lookup rules are all a good thing.

2 comments

It is so well designed, that is getting fixed in C2y,

"...is a deeply hated C feature that everyone likes to dunk on for both being too much and also not being good enough at the same time"

https://thephd.dev/improving-_generic-in-c2y

I have made a lengthy comment about why I dislike C23. I cannot find it right now, but yeah, mainly because it is kind of turning into C++ and I do not like that, that is why I will continue sticking to C99. The earlier version of the book is great for that.
I have to say, of all programming languages, C is the one which gets the most strident opposition to the most minor of changes.

I would love to read your reasoning because so far I have not been able to understand the stiff resistance to what I see are very positive changes aimed at cleaning up so much of the mess that is C.

I found one of the threads, there were others, too, IIRC.

https://news.ycombinator.com/item?id=41854897