My top rule for APIs is that simple things should be simple. If I want a minimal HTTP listener, don't make me create and intricately combine a dozen ConnectionReuseStrategy and ContentProducer and HTTPEntityEnclosingRequest objects. Apache HTTPComponents, I'm looking at you.
I tend to achieve that by making a few layers of access. I try really hard to make every chunk of re-usable code I write work with as few arguments as possible in the most common uses. Usually, this means one or two at most.
There are cases where HTTPEntityEnclosingRequest objects could be useful to be able to declare... but most of the time you just want port.listen(delegate). I boggle at how few systems have easy-use methods along those lines, and how so many things return 'void' instead of 'this'.
No comments on the page nor Youtube (not that I go to youtube for valuable comments...), no summary, and no captions.
Maybe I'll look at it later. Videos are an extremely slow way to absorb information, especially presentation-style videos where people speak slowly and clearly and try to explain everything so everyone will understand it.
Joshua Bloch gave a talk in 2006 that was about "real" API design, not REST API design, and is mainly concerned with much-loathed Java, but despite all this I think it's still very relevant and well worth watching. It's about an hour long.
7 comments
[ 4.4 ms ] story [ 21.0 ms ] threadThere are cases where HTTPEntityEnclosingRequest objects could be useful to be able to declare... but most of the time you just want port.listen(delegate). I boggle at how few systems have easy-use methods along those lines, and how so many things return 'void' instead of 'this'.
Also...hahahaha HTTPEntityEnclosingRequest
Maybe I'll look at it later. Videos are an extremely slow way to absorb information, especially presentation-style videos where people speak slowly and clearly and try to explain everything so everyone will understand it.
Always interested in feedback, either on giving better talks or on making better APIs / developer experiences.
http://www.infoq.com/presentations/effective-api-design