4 ms·
Would you be willing to elaborate a little more on what you hate about Java? You mentioned "complexity and over engineering", which is what I hate about it the
by geebee 16y ago
Would you be willing to elaborate a little more on what you hate about Java? You mentioned "complexity and over engineering", which is what I hate about it these days too.
The thing is, I used to like Java. While I've been mainly interested in Ruby/Rails for personal projects, I've had to keep coding in Java for my work, and I've started to hate it too. But there are a lot of things I still like and miss about it, including moments when I think I'd actually still choose to use Java for a project.
Looking back, I think my enjoyment of Java ended around 2005, which was when Servlets and JSP were replaced with Struts, Spring, and Hibernate. I know a lot of people felt this was a huge improvement over the original EJB, but personally, I was astonished that people thought Spring, Struts, and Hibernate were "lightweight" (I never even bothered with EJB). While these frameworks have improved greatly and aren't nearly as hard to use as they were a while back, but I still don't like coding in them.
I think I miss the "recipe" approach prevalent prior to 2005, where you stuck closer to the "low level" servlet/jdbc approach, and you either brought in a new library for a specific task, or decided to write the code yourself. It was a bit laborious, but there wasn't much you couldn't do if you were willing to do a lot of typing. This approach seems to be an evolutionary dead end now - people generally start their projects in a framework (rails, django, spring), and stay within it for the remainder of the project. So there isn't really any point to a servlet "cookbook" anymore. It's either a Spring cookbook, or a Struts cookbook...
I think some new technologies have made Java more enjoyable - especially Maven, but I felt that Spring made Java far less enjoyable. It's a personal opinion, but to get a sense of it, I recommend you try working through the SpringMVC tutorial on the SpringSource site. Like I said, this is pretty much just a personal preference of mine - if, after doing the tutorial, this seems like a great way to write web apps, then by all means, go for it. But personally, I can't stand it.
I've been wondering if maybe there's a niche out there for people who like to use java at the low level. The funny thing is, I obviously do like frameworks, since I'm pretty enthusiastic about Rails. I think that it's just that if I'm going to use Java instead of Rails, then obviously there's a reason, and it's probably because my tasks are taking me outside the normal operations of a framework.
I think this comes down to wanting to be either at a very effective and efficient high level of abstraction, or wanting to get down into the grit of the problem and be able to do anything. While there was a time that it would have seemed funny to refer to anything Java related as "low level", pure servlets and jdbc seem to be taking that role in the middle tier (not just within SpringMVC or JPA/Hibernate, even non-java languages seem to be compiling to Java to run on the JVM).
Ok, this is a long rant, maybe it should have been a separate post completely. It just seems like we're in the same spot, and I want to ask you - do you think you might enjoy Java more if you dropped back from the enterprise-framework thing and started using it where (in my opinion) it still excels, the "low-ish" level of the middle tier? I wonder if other people are starting to feel the same way I do about this - that Java has its place, but when it does, your probably going to want to be going in as low level as you can with the language - otherwise, you'd be using something else.
- rlawson 16y agoSure. First I like Java the language. I dislike Java the enterprise platform. I don't like XML as another programming language, I don't like having to fire up a giant container to test a piece of code (looking at you weblogic). Now things are probably moving in the right direction - I did try EJB3/JPA and it was ok. But I'd hate to be a new programmer coming to Java and being confronted with Spring, EJB, Hibernate, JSF and an app server just to shove some data in and out of a database.
- geebee 16y agoI agree that things have moved in a better direction lately. I recently wrote an app using Struts 2, Spring, and JPA (backed with hibernate), and I made heavy use of annotations that did greatly reduce the amount of XML. I'd agree with you, though, that this would be a nearly impossible (and probably pointless) task for a newcomer (including experienced developers who haven't done much Java). I almost have to wonder who even uses these things anymore... they're too complicated for programming newbies, and I have trouble believing that an experienced programmer from Rails or Django would be willing to put up with it. Are the only people who use this stack existing Java developers who learned java back when it was manageable? I can see someone slowly backing into these frameworks incrementally (like you and I did), but if you're new to Java, it's got to be a thousand pages of reading. I'm prepared to believe that a smart, studious person still wouldn't be there in six months. What do you think about my other suggestion - dropping back to a lower level of code for java applications? I don't think the servlet/jsp approach is anywhere near as hard to learn, and I think it can be effective. As for not reinventing the wheel... well, I'm all for bringing in components incrementally as you need them - MVC, web service APIs, DI containers. What do you think - could Java be more popular if the "java community" embraced the lower level approach, starting with Servlets/JDBC, and leaned toward gradual integration of technologies as needed? (I know, it's hard to speak of a "community", it's really just a collection of individuals, but it seems like the overwhelming thrust of the Java world has been starting within frameworks that add tremendous overhead at the start and actually sometimes become a hinderance as the app grows).
- rlawson 16y ago