3 ms·
I did “false object” programming with C, back in the mid-90s. I never read this book, but we came up with similar approaches. I got the idea from QuickDraw GX.
by ChrisMarshallNY 3y ago
I did “false object” programming with C, back in the mid-90s. I never read this book, but we came up with similar approaches. I got the idea from QuickDraw GX. I passed around structs, as “nouns,” and some had built-in “verbs.”
I used function pointers, and these created kind of a “poor man’s vtable.” Not exactly “polymorphism,” but similar.
I needed to do it for a modular imaging peripheral SDK. Back then, the only reliable way to cross an external module boundary was with ANSI C (stack conventions).
It worked quite well, as they were still using the same SDK, 25 years later.
WFM. YMMV.
- gpderetta 3y ago> I used function pointers, and these created kind of a “poor man’s vtable.” Not exactly “polymorphism,” but similar. It is indeed polymorphism. A form of interface polymorphism I guess.
- ChrisMarshallNY 3y agoWell, the hierarchy needed to be manually maintained. There wasn't really any kind of "super" or "parent."