News for hackers. Stuff that matters.
Re:If Inheritance is so bad, why does everyone use it? by mrkeen on Thursday April 11, 2024 @04:50AM (#39999929)
> Polymorphism is doable in plain old C with lookup tables and function pointers

Not without casting. qsort is still:

    void qsort_r(void *base, size_t nmemb, size_t size,
                 int (*compar)(const void *, const void *, void *),
                 void *arg);
Re:If Inheritance is so bad, why does everyone use it? by chuckadams on Friday April 12, 2024 @11:22AM (#40013956)
Presumably one would write an object-oriented version of quicksort to go with their OO C library design and not use the stdlib functions. For example GObject is OOP in C, and I imagine it has collection types with sort methods.

Inheritance is what will bite hard when hand-rolling OOP in C. For one, you can forget about the compiler enforcing substitutability and co/contravariance for you.