3 ms·
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 ConnectionR
by orangecat 16y ago
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.
- Groxx 16y agoI 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'.