“Infinity” is a Bad Default Timeout

March 17, 2017

Many libraries wrap some external communication. Be it a REST-like API, a message queue, a database, a mail server or something else. And therefore you have to have some timeout – for connecting, for reading, writing or idling. And sadly, many libraries have their default timeouts set to “0” or “-1” which means “infinity”. And […]


Coping with Methods with Many Parameters

February 21, 2014

I will put my captain Obvious cape now and write in short how to get rid of methods with many parameters, especially if some of the parameters are optional, or depend on each other somehow (e.g. go in pairs, one excludes another, etc.). Let’s take a simple RestClient class. You need to be able to […]


Appeal to API Designers

February 18, 2010

If a developer has used the Java security APIs he already knows what’s ahead. That’s not the only example, alas, but I’ll be using it to illustrate my point. These APIs provide their configurable properties through singleton maps. Security.setProperty(“ocsp.enable”, “true”); for example The documentation of these properties is not always in the most visible place, […]