Re: [AD] Proposal for new branch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I didn't just mean that kind of overhead. Everytime you add a new public function you have to (1) add a function declaration, (2) add a wrapper function, (3) add a method in some vtable, (4) update old driver tables, (5) add platform-specific definitions.

You're already having most of these problems: ok you don't have wrappers, but what you call wrappers usually also do lots of checks and functionalities shared by all ports, so they reduce code duplication. The vtable updating is almost the same as the need to write the new function for the other ports. Platform specific definitions are the only real complain I can think of (see: declaring new vtable hooks), but they do not overcome the advantages brought by vtables IMHO...

Maintain: probably, but vtables are not the only way to reduce duplication.

I can think of unique private functions doing setups for the many (one per port) userland ones... But doesn't that lead to over complicated code? vtables looks so much cleaner to my eyes!

Readability: no way. An extra layer of indirection that could point to nearly anywhere -- and sometimes the pointer changes!

I can't think of any way for the pointer to change once the lib sets it up, unless the user changes it...

--
Angelo Mottola
a.mottola@xxxxxxxxxx
http://www.ecplusplus.com





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/