top | item 15401503

(no title)

Nvorzula | 8 years ago

> I argue that clear use of function pointers is the heart of object-oriented programming. Given a set of operations you want to perform on data, and a set of data types you want to respond to those operations, the easiest way to put the program together is with a group of function pointers for each type. This, in a nutshell, defines class and method. The O-O languages give you more of course - prettier syntax, derived types and so on - but conceptually they provide little extra.

I think that this might be an early hint at Go's interface system and its lack of of "complete" OOP support.

discuss

order

pjc50|8 years ago

Well, it's more like the "C with Classes" approach that was the precursor to C++; "group of function pointers for each type" is basically a vtable.