Posts

Showing posts with the label API

Rule of thumbs for API designing

I have just read a very interesting article " API Design Matters " by Michi Henning . He discusses the problem with bad designed and gives some rules of thumb. We all have some time used an API that does not feel right and makes the coding hard. It is very interesting to read Michis analyze of this and why. My feeling is that he had put the hammer right on the nail. Here is a summary of the rules he discuss. I assume you will feel like me when you read them; yeah thats obvious. But thats the nice thing and the important is to get the list. An API : must provide sufficient functionality for the caller to achieve its task. should be minimal without imposing undue inconvenience on the caller. should be policy free if it is general purpose. should be policy rich if it is special purpose. should be designed from the perspective of the caller. don't let the caller configure "everything". should be documented before it is implemented. If you want to read the discussion...

Don't write another line code until you have seen this

I think this talk is one of the best talk I have found in Googles Engineering series. Google talks are generally very good, but this is even better and has a good speaker. Joshua Bloch talk "How To Design A Good API and Why it Matters" presents a lot of good information what to think about when creates API:s. Even if you aren't writing another framework it is important. I think people seems to believe today that reuse can only be done using frameworks. Joshua points out the importance of good API:s inside your program and for different modules. I would also like to add that this is important when designing new XML-DTD:s, which is a kind of API. For instance, I have seen XML file formats that says the address-tag includes space separated e-mail addresses. Why not use multiple address-tags, one for each address. In this way I can solely use my XML-parser to parse the file and do not need add extra code to separate the sting at spaces. If you do not have an hour at the mo...