Just thought I'd say my thoughts on the different parameter setting function
proposals we've had so far...


Individual functions for each parameter:

 Pros:
 - None. ;)

 Cons:
 - Litters the API with "thousands" of functions.
 - If the parameter's type changes, the API has to change.
 - If a new parameter is introduced, the API has to change.


Giving a parameter structure:

 Pros:
 - Hmmm, none. ;)

 Cons:
 - You have to be very careful not to disturb the order of the parameters.
 - You end up with a bunch of duplicates if you have to change parameters.
 - Different compilers can cause different alignments.


Giving tag-pairs on stack to one function which parses them:

 Pros:
 - API never has to change.

 Cons:
 - Littering with different tags for each type.
 - It's possible to pass the wrong type.


Giving tag-pairs on stack to 3 functions (one for each type):

 Pros:
 - API never has to change.
 - One tag for any type.

 Cons:
 - It's still possible to pass the wrong type, but it's much clearer since
   the function itself states which to pass.


- CISC

--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to