Live data from Hacker News

Ask HN: Enterprise Java guy needs advice on what to transition to

news.ycombinator.com

41–50 of 57 posts

Re: Ask HN: Enterprise Java guy needs advice on what to transition to

#41
post #40
post #38

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, in…

Sure. 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, J…

I 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).

Re: Ask HN: Enterprise Java guy needs advice on what to transition to

#42
post #41
post #40

Earlier quoted context omitted.

Sure. 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, J…

I 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…

yeah you are right, I learned servlets / jsps from Marty Hall's book and then just progressed from there. For smaller projects I usually start with Tomcat + Stripes + iBatis Sql Maps in order to minimize the learning curve. But no self respecting corporation would consider that stack (even though it is free, easy to learn and very fast).

Re: Ask HN: Enterprise Java guy needs advice on what to transition to

#43
post #39

I couldn't agree more. For most projects today, Java is severe overkill where a more high level language is better suited. While I'm not a fan of the Java language, the Java platform is rock solid and we can all agree it's not going away anytime soon. I'd recommend taking a look at JRuby. It works nicely with Java libraries and loading Java classes. You don't have to deal with dependency injection. Variables aren't t…

I've been thinking about DI in Ruby, and I've been trying to think of how I'd deal with the absence of DI in Rails. Here's a scenario... Suppose you have two different ways of gaining information about a logged in user. Let's say one goes to LDAP, and the other goes to an RDBMS. You'll be using one or the other depending on where the software is installed. So in Java, you create an interface that defines the methods…

Your question is more in regards to Ruby itself, and not Rails. You don't have to swap out implementations in Ruby.

Implementations aside, when you do DI in Java, it serves two purposes: 1) instantiates an object and 2) wires it into another object. Remember that in Java, each class is in it's own file. In ruby, you can break classes into several files, but you don't have to. Ruby simply reads class declarations at runtime and instantiates those classes into constants. This means that your classes are always available. If you've defined a class method, you can call SomeClass.some_class_method. If you want to work with an instance of that class, you would call SomeClass.new - to which you can pass args to a constructor.

In your instance, you could have three classes - User, UserLdap, and UserDb. You might call User.find( person ), and in the find method you would test your conditional on whether to use UserLdap or UserDb. If you had common methods you wanted to share between the two, you could place those in User and extend that class for use with an instance object. Another option for sharing methods cold be to place them in a module, which you can then include in your class.

It's hard for me the make a recommendation for your specific problem at hand. My best advice is to read up and Ruby a little and begin to put what you learn into practice. Here's a couple of recommendations:

http://www.humblelittlerubybook.com/

http://mislav.uniqpath.com/poignant-guide/

My light bulb moments were realizing that all class declarations are loaded as constants at runtime and class & instance methods are also managed in the same class declaration. HTH.

Re: Ask HN: Enterprise Java guy needs advice on what to transition to

#44

Start with Scala. Then try Play! and such. Also look at GWT. And do iOS. Much better job market than Python etc. http://blog.getgush.com/ I'd stay away from Groovy etc. Also, please get over that "scaling" stuff. PHP scales just fine. Rails scales just fine. Python scales just fine.

Why stay away from Groovy?

The Java programmers I know consider it bloaty and oldskool.

Re: Ask HN: Enterprise Java guy needs advice on what to transition to

#45
I'm walking the same road, been working on the Java platform for 8+ years. The recent trend of new languages on top of the JVM is really exciting, so you have several options to investigate without trowing away all your existing Java knowledge.

Groovy + Grails is a great platform and it feels like a grasp of fresh air, but there is also Clojure (with an emerging ecosystem), JRuby (and you can run Rails on it), Jython and Scala to name a few other options.

Re: Ask HN: Enterprise Java guy needs advice on what to transition to

#48
post #42
post #41

Earlier quoted context omitted.

I 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…

yeah you are right, I learned servlets / jsps from Marty Hall's book and then just progressed from there. For smaller projects I usually start with Tomcat + Stripes + iBatis Sql Maps in order to minimize the learning curve. But no self respecting corporation would consider that stack (even though it is free, easy to learn and very fast).

What do you think are some of the factors behind the resistance to some of these alternative frameworks? I've heard good things about stripes. But it seems like almost every MVC framework other than Spring MVC is losing mindshare. I actually think Struts 2 is a nicely designed framework, but the association with Struts (which is actually an almost completely different framework) may have doomed it.

Almost everyone using Spring for DI seems to be leaning toward Spring MVC these days, probably because they don't want to do too much pick-and-choosing. And the default choice for a DI framework seems to be Spring as well, which means a Java programmer is now a Spring programmer.

This is probably why the "java cookbook" style books haven't been updated since 2004. They're treated as an evolutionary dead end, though I don't think they should be.

Re: Ask HN: Enterprise Java guy needs advice on what to transition to

#49

Frankly I am tired of all the complexity and over engineering of enterprise Java. For all the effort, I find most apps are large (1+ MLOC), monolithic, hard to understand and maintained by large groups of onshore/offshore resources who just keep the stuff running by sheer numbers and have no pride in their craft. If this is the type of thing you want to move away from, then I don't think that the problem is teams tha…

> The language/tools are not the problem, it's the people/organization.

The language is a problem, because Java was specially created for this type of organizations. And it is not surprising that Java attracts this type of people (fungible crowds having no pride in their craft).

Re: Ask HN: Enterprise Java guy needs advice on what to transition to

#50
post #49

Frankly I am tired of all the complexity and over engineering of enterprise Java. For all the effort, I find most apps are large (1+ MLOC), monolithic, hard to understand and maintained by large groups of onshore/offshore resources who just keep the stuff running by sheer numbers and have no pride in their craft. If this is the type of thing you want to move away from, then I don't think that the problem is teams tha…

> The language/tools are not the problem, it's the people/organization. The language is a problem, because Java was specially created for this type of organizations. And it is not surprising that Java attracts this type of people (fungible crowds having no pride in their craft).

I disagree that it's possible to paint all developers using this language with such a broad brush. By this notion everyone that uses Rails loves being a "ninja" and monkey patching.
Post reply on HN