Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
User Journal

Journal Com2Kid's Journal: Horrid API interface design

Before you call functionA(double f), functionB(double &f) must be called. functionB will modify the bits of f that is passed in to it, these modifications are necessary before functionA is called.

This will not be mentioned in comments within the source, or in documentation.

OK granted this instance of silliness was found in an example program, but that is is not much better than in production, after all, examples are meant to be clear cut and easy to understand!

And who in their right mind thinks this way? Have functionA copy f, pass the copy along to functionB, and make the entire process transparent to the user.

API programmers have users too!

On a related note, ick working in C++ now. Only because I wanted access to C's Unions and everything, and I do not have time at this moment to learn (the incredibly powerful I must say!) bitarray techniques that C# has. For a language that runs in a VM, C# allows some cool bit manipulation stuff. Every bit is directly accessible, which is incredibly cool, but I really fail to see the point when a single use of RTTI in an application would more than kill any performance advantage that comes from the sort of evil bit crunching that C# allows.

(Still doesn't mean that it wouldn't be fun, hehe)

This discussion has been archived. No new comments can be posted.

Horrid API interface design

Comments Filter:

"It's the best thing since professional golfers on 'ludes." -- Rick Obidiah

Working...