Re: Very Simple, Minimalist Technique For OOP in C...
- From: Johan Bengtsson <qwerty_42@xxxxxxxxxxx>
- Date: Sun, 24 Jun 2007 19:53:57 GMT
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@xxxxxxxxxxxxxxI 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).
.
- References:
- Very Simple, Minimalist Technique For OOP in C...
- From: Chris Thomasson
- Re: Very Simple, Minimalist Technique For OOP in C...
- From: Malcolm McLean
- Re: Very Simple, Minimalist Technique For OOP in C...
- From: Chris Thomasson
- Very Simple, Minimalist Technique For OOP in C...
- Prev by Date: Re: C/C++ Ambiguity in Order of Evaluation
- Next by Date: Re: xmalloc
- Previous by thread: Re: Very Simple, Minimalist Technique For OOP in C...
- Next by thread: Fill structure's fields in a loop ?
- Index(es):
Relevant Pages
|
|