boagz57
However he also advocates to ALWAYS write the usage code first and work towards those original ideas of how the api should be structured. Don't these two ideas sort of conflict with one another? If I'm trying to think of functions/structs to write for my api from the start, then I'm sort of pre-planning my api design instead of letting the code guide me to what's appropriate. So when I'm I suppose to have the compression oriented mindset and when should I be trying to write the usage code first?
The amount of up front work you can do in designing an API depends largely on how trivial (to you) that API is going to be. If fairly trivial then you may be able to do the whole thing up front on paper. If not so trivial, then usage code is a perfectly good starting point and obviously some iteration will be required.
I haven't read the compressions oriented post but I presume that the basic idea is something like, wait until you actually know that more than one part of your code base will need to use a given function/module before creating a more generalized function or public interface.
Wether you start with usage code or data structures and public functions doesn't make a whole lot of difference because you're going to have to iterate either way. The usage code will likely change in response to you structs and public interface changing while your public interface and structs will likely change in response to your usage code changing.