dagblog.
← Archive

On complexity


Is Java really so cumbersome for building web applications, or is that a myth? Excessive complexity is one of the drawbacks people often cite. Others include hosting and deployment. Back to the complexity of Java for web applications. Let's ask where it comes from.

When I discussed this with Vlasta Vávrů, who can compare the Java and PHP worlds, what emerged from our conversation, or at least what I took away, was that building web applications in Java requires much more knowledge. We ended up talking about separating layers, transaction management, optimistic locking and ORM frameworks. The crucial question is whether you need all those technologies and practices.

In the Java world, every other person will tell you that of course you do. There is so much information about it that it becomes common wisdom. “Want to build a web application? You'll need technology X, transactions, ORM solution Y and so on.” Plain JSP, servlets and the standard Java API actually suffice. If we accept that and set aside the infrastructure problems from the start of the article, the complexity of that setup (JSP, servlets, J2SE API) is comparable to PHP.

Then any experienced web developer will promptly remind you that data and presentation should be separate. You end up with some kind of MVC framework on any platform. That adds another layer of complexity, and you can keep piling it on. What matters is recognizing how much complexity is acceptable for the application and stopping there.

We cannot simply say building web applications on RoR is easier than doing so in Java or PHP. We always have to consider the complexity the application calls for. That said, I think some Java web applications add unnecessary complexity and are overengineered. To my mind, that is no reason to consider Java generally too complicated for web applications.

Medium version

Related articles

Related CZ Podcast episodes