3 ms·
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 ca
by mmaniac 2y 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.
- johnisgood 2y agoI 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.
- chongli 2y agoI 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.
- johnisgood 2y agoI found one of the threads, there were others, too, IIRC. https://news.ycombinator.com/item?id=41854897 https://news.ycombinator.com/item?id=41854897
- pjmlp 2y agoIt 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 https://thephd.dev/improving-_generic-in-c2y