Wouter van Ooijen wrote: >> You can definitely benefit from the "OOP in C" approach. > > Recently I had to do some small modifications on a project that was done > "OOP in asm". All variables resided in objects, and pointers to those > objects were passed around. The silly thing was that there was only one > instance of each object... Maybe worse was that there were almost no > comments (and little other documentation), and half of it was subtly out > of phase with the code. > > So maybe there is a place for "OOP in XXX" (where XXX is a non-OOP > language) but it raises the possibilities for horrible code to a next > level. You may remember when I first started looking into OOP for C, Xiaofan suggested a couple of articles where the authors were emulating C++ in C. IMO their implementations are a huge overkill, and I would have probably failed miserably if I followed in their footsteps, because I'm not 1/10 as good a programmer as they are. Luckily, an author of a book on patterns suggested, "favor aggregation over inheritance". If you don't use inheritance in your code, the task of emulating OOP in a procedural language is greatly simplified, and you still get 90% of the benefits. Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist