4 ms·
I'd probabl have to argue in favor of writing convenience methods to make a usable api right off the bat. For example, I don't necessarily NEED the strlen metho
by Allocator2008 18y ago
I'd probabl have to argue in favor of writing convenience methods to make a usable api right off the bat. For example, I don't necessarily NEED the strlen method, since I can make my own with little trouble, but it is sure nice to have. I'd say the more public methods there are in one's API the better. This way in the java world, you can have a public interface with all the methods a client developer could ever want, but protect (hide) the implementation of these methods. Without a good set of available public api methods, you a) inconvenience the target developer and b) make it impossible to hide the implementation, since to do anything useful with the application, the developer would need to know the "guts" of it, since the public api isn't good. So yes, probably this is a matter of taste, but in the spirit of "do unto others", personally I like having "conveniences" like the strlen example, and so I like to make similar "conveinces" when I'm writing code myself.