Johannes Stezenbach wrote: > On Sat, Apr 02, 2005 at 12:28:20AM +0200, Kenneth Aafl?y wrote: > >>On Saturday 02 April 2005 00:13, Johannes Stezenbach wrote: >> >>>Kenneth Aafl?y wrote: >>> >>>>} vid_dev_info_t; >>> >>>Please don't use typedefs unless you are explicitly defining >>>opaque data types. It makes it more difficult to see what's going on. >> >>I'm wondering if you recentment is against the typedef in general or the >>implementation of a clean api. > > > I'm neither agains typedefs, where they make sense, nor against clean APIs. > > >>The api will be well documented, and so >>will the new typedefed types? I was merily following the alsa api here, >>so I'm not in any way married to it yet! Any suggestions is very much >>welcome, please prove why your suggestion will produce a cleaner api. > > > Typedefs have a purpose: Creating an abstraction, i.e. hiding > information about the type from the user. IMHO it is totally useless to > stick a typedef on every struct or enum definition. All you get is > obfuscation. And the _t suffixes are ugly, too. > Please ask yourself if and why you want to hide from the users > of your API why e.g. vid_dev_hierarchy_t is an enum. > Yes, typedef's really make opaque data types, The programmer feels really comfortable, but a newbie would find it quite a bit hard, ie, a larger learning curve for the new types. ie, a longer period somebody has to work on that to get moving. Manu