3 ms·
Of course a design centered around structs equipped with function pointers is, in fact, an object system.
by millstone 9y ago
Of course a design centered around structs equipped with function pointers is, in fact, an object system.
- cperciva 9y agoSure. But realizing that objects are just structs with function pointers takes you from a binary "this code uses objects" vs. "this code doesn't use objects" to a more flexible "this code is designed in a more objecty way than that code". A lot of people think about objects as a language feature, when they're really a design paradigm; and like all good design paradigms, you can use more or less of them depending on how well the paradigm fits a particular piece of code.
- lacampbell 9y agoTo an extent - with the caveat that there are entire languages built around this design paradigm, such that using objects is the syntactic past of least resistance. I agree though, when I dabble in C I often end up writing objecty code. Sometimes it's even a bit functional..