News for hackers. Stuff that matters.
Re:I stopped everything and started writing C again by PaulDavisThe1st on Wednesday March 12, 2025 @04:18PM (#43347256)
> We designed what I call "false object pattern." It used a C struct to simulate a dynamic object, complete with function pointers (that could be replaced, in implementation), and that gave us a "sorta/kinda" vtable.

You were not alone in this. It is the basis of glib's GObject which is at the bottom of the stack for all of GTK and GNOME.

Re:I stopped everything and started writing C again by synergy20 on Thursday March 13, 2025 @01:23AM (#43350606)
sadly glib doesn't have error handling for memory errors,it will just crash. otherwise it can be widely used as a oop c
Re:I stopped everything and started writing C again by ChrisMarshallNY on Thursday March 13, 2025 @08:34AM (#43352632)
I got the idea from Apple's QuickDraw GX. It used a similar pattern.