Saturday, September 28, 2013

You're What You Depend On

People love 3rd party libraries, especially those from Apache, Google, etc. But I'd like to ask a question, how do you really find vanilla Java SDK hard to use?

The reason I ask the question is, I found a dependency of in a project and the only usage of Google Guava throughout the whole project is:
import static;

Wow! I'm sure the programmer thought the same when he decided to make the project depend on Guava. I'm also sure he was so excited and didn't even bother to check the magic implementation in Guava:
import java.nio.charset.Charset;
public static final Charset UTF_8 = Charset.forName("UTF-8");

I feel sorry for the programmer, not only because he introduced an unnecessary dependency, but also he lost a chance to learn from 3rd parties to master Java SDK better.