Re: Very Simple, Minimalist Technique For OOP in C...



Chris Thomasson wrote:
"Malcolm McLean" <regniztar@xxxxxxxxxxxxxx> wrote in message news:kZGdnQrKOJaQ_ebbRVnyugA@xxxxxxxxx

"Chris Thomasson" <cristom@xxxxxxxxxxx> wrote in message news:h_GdnYjvyb3P2efbnZ2dnUVZ_tGvnZ2d@xxxxxxxxxxxxxx
I was wondering if you have come across any superior methods for very basic OOP in C?
[...]
However it really is a lot of trouble. The syntactical support isn't really there, so code quickly becomes a complete mess.

Yeah, that seems to attempt to support more OOP techniques than the "minimalist" method posted, which only provides an abstract interface technique.

You are right, the syntactical support isn't really there, but it is quite possible to do full OOP in C with virtual functions and everything, and it isn't that hard to do really.
It is even possible to do it better than in C++ with respect to using an object oriented plugin system, something not easily done in C++, at least not if you are *not* interested in recompiling every plugin at any change in some of the base classes. I do not know about C# or other languages - it might be better solved there but C is somewhat easier because everything becomes visible and that makes it easier to see the limitations and understand what happens. (I have done two implementations of plugin based object oriented systems, one in C++ and later one in C, the one in C actually meets the specifications better even if it is more lines of code to do the work).
.



Relevant Pages

  • Re: On assembly and portability (between Linux and Windows)
    ... >>Well define those terms and give us examples of HLA that supports it. ... That defines C++ but not OOP. ... HLA has no VMT ... and has no real OO support I can see, it appears to only pretend to support OOP. ...
    (alt.lang.asm)
  • Re: OO in Forth
    ... language which has little support for OOP in itself. ... and data structures it intends to support -- think filesystems or ... That's OOP. ...
    (comp.lang.forth)
  • Re: [PHP] Re: php 4 and 5
    ... Most important change is Object Oriented Features. ... PHP 5 support ... I think you mean supports "more" OOP features. ... PHP4 had plenty of OOP ...
    (php.general)
  • Re: On assembly and portability (between Linux and Windows)
    ... HLA does not. ... It isn't taught in almost every university in the world ... HLA fully supports OOP (except multiple inheritance, ... >which no assembler can easilly support). ...
    (alt.lang.asm)
  • Re: On assembly and portability (between Linux and Windows)
    ... > just plain blah. ... HLA fully supports OOP (except multiple inheritance, ... > which no assembler can easilly support). ...
    (alt.lang.asm)