News for hackers. Stuff that matters.
Re:Object-oriented techniques in C by halayli on Tuesday September 22, 2015 @05:14PM (#10261755)
Every solution feels great and neat in the beginning until you wake up one day and feel sick to your stomach from the mess it has created.

Most vtable like implementations in the kernel are nothing more than struct of function pointers, and this is almost exclusively.

Re:Object-oriented techniques in C by dimonomid on Tuesday September 22, 2015 @05:34PM (#10261864)
As nostrademons pointed out above (https://news.ycombinator.com/item?id=10261375), if you feel that some tool you've used has created mess (so that you even feel sick to your stomach), it's most likely not because the tool is bad, but because you've used it in inappropriate way.
Re:Object-oriented techniques in C by deathanatos on Wednesday September 23, 2015 @02:33AM (#10263603)
As an example, SDL is a large C codebase that employs a very OO paradigm, and I find its APIs very well organized.

When I was (or am) coding C, a lot of the OO principles helped me write better C code, as I understood better what the higher level constructs that I was working with was. (i.e., if there's a base class among essentially hiding among my structs that should perhaps be pulled out into a separate struct; do I need a vtable, or perhaps function pointers on the struct; how is a struct initialized, and how is it destructed, etc.)

Re:Object-oriented techniques in C by EliRivers on Wednesday September 23, 2015 @09:03AM (#10264736)
I once met a software engineer who was able to write code that was, and remained, maintainable. Crazy, right.