OOPC on large projects, in practice? 
Author Message
 OOPC on large projects, in practice?

Hi, I've been thinking about using the OOP techniques described in

http://www.*-*-*.com/

to implement a large (single-person) project with an OO design. I've
played around with these techniques on toy problems, and they seem
quite nice. Does anybody have any experience on using these OOPC ideas
on large projects, and any feedback as to how it turned out?

In essence, I suppose I'm looking for a nice set of conventions and
techniques for OO programming in C, but I don't want to end up (in a
few months' time) in a situation where everything is painfully
verbose. If it turns out to be inappropriate, then I might just start
learning C++.

Thanks for all your advice.

Alistair



Thu, 08 Sep 2005 00:24:34 GMT  
 OOPC on large projects, in practice?

Quote:

> Hi, I've been thinking about using the OOP techniques described in

> http://ldeniau.home.cern.ch/ldeniau/html/oopc/oopc.html

> to implement a large (single-person) project with an OO design. I've
> played around with these techniques on toy problems, and they seem
> quite nice. Does anybody have any experience on using these OOPC ideas
> on large projects, and any feedback as to how it turned out?

here's a trick i learned on c.l.c. the key is to remember that a pointer to
a struct is guaranteed to be a pointer to the first member of that struct. i
use that for single inheritance somewhat like so:

struct object {
        pthread_mutex_t m;

Quote:
}

struct thread {
        struct object o;
        void *(*callback)(void *);

Quote:
}

struct daemon {
        struct thread t;

Quote:
}

i can have a generic locking mechanism that i can pass all objects who
inherit struct object, and i can have common thread routines that
can fire-up random objects that need to run in their own thread. it
helps to generalize a lot of stuff, but of course you have to be meticulous
w/ initializations.

Quote:
> In essence, I suppose I'm looking for a nice set of conventions and
> techniques for OO programming in C, but I don't want to end up (in a
> few months' time) in a situation where everything is painfully
> verbose. If it turns out to be inappropriate, then I might just start
> learning C++.

well, i does get rather verbose, and of course you probably end up
circumventing type-checking a lot, which you quickly realize is
counter-productive. i'd say much of the time it's just not worth it.

maybe you should look into objective-c.

otoh, OOP isn't all it's cracked up to be. a well thought-out C interface
is far better than an OOP interface written to Design Pattern: Elements
of Reusable Object-Oriented Software.

also, i've yet to see OOP-written code that wasn't painfully verbose.
let me know when you spot that unicorn.



Thu, 08 Sep 2005 01:35:27 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Practice Project

2. MORE Practice Programming Projects: a listing

3. THANKS! or Practice Progamming Projects 2

4. Practice Programming Projects

5. Error when XML-parsing large SOAP responses in a VC7/ATL project

6. Large Projects/Multiple Files

7. how to write large projects?

8. C for "large" software projects

9. Help: Need to simplify a Makefile for a large project

10. Best Large Project Development Environment - HELP!

11. Advice needed on large database project

12. problems with compiling large project under gcc + ms-dos

 

 
Powered by phpBB® Forum Software