Java, PHP, Programming, Ruby
If not Java EE, then…?
A prediction: if a couple years from now I am still mired in a Java monoculture, I will strangle someone. Probably myself.
As I have explained before, and with some apology for the double negative to which I am about to subject you, I do not believe that Java can never be viable for web application development, or that it is a bad language. I simply assert that it is an exceedingly poor choice for the web applications that I work on. Because it’s past 1 a.m. and my son will be waking me up in less than five hours, and maybe because despite my curmudgeonly nature I am reasonably polite after all, I will spare my employer the (mild) embarrassment of an all-out rant. Suffice it to say that working among the Convinced as I do, I am very much in the minority in my belief that Java EE — really, a Java monoculture — is the number one culprit for the project I’m working on being so very, very late. It isn’t the only problem we have, but it’s a big one.
The question I’m left with is this: what do I propose as an alternative?
.NET is out. We’d need lots of new hardware and be locked with a single, closed-source vendor. Please do not bring up Mono.
Cold Fusion? Same single-vendor problem, and I remain unconvinced.
There are Python frameworks like Django and TurboGears. I like them. They’re just not compelling enough for me to suggest using them.
Tcl? Sorry, private joke.
To my mind, it comes down to PHP (using any of a number of frameworks) or Ruby on Rails.
We would stand to benefit more from both Ruby and Rails, but I am concerned about deployment scenarios. Large-scale Rails deployments are possible, but it’s still a new enough platform that people are still working out the kinks for how to do it well. To be honest, we’d just be talking about a medium-size deployment, but the same concerns apply. Could we do it? Yes. I have faith in our system administrators and our developers. I would just feel really guilty about going to them every 3-6 months with a new way of setting up the servers to deploy Rails apps. I admit that I haven’t been following that scene for a while, but it does seem every time I poke my head in that there’s something significantly different.
On the other hand, I’m satisfied that we know how to work well with PHP, at least from a sysadmin perspective. On the development side we would certainly move a lot faster than we do with Java. As PHP becomes more Java-like, you’d think that a transition from Java would be easy. That’s the whole point, right? PHP has a low barrier to entry. On the other hand, its similarities to Java (at least in the object model) may make the transition harder, as I’ve found that Java programmers are somehow blinded to or misunderstand significant platform differences — e.g. PHP’s share-nothing architecture. We would also struggle with maintaining a large PHP codebase, much as we struggle maintaining Java code in reasonable order.
But honestly? In my gut, I hesitate to propose PHP because of the language itself. It doesn’t feel that much better to write PHP code than Java code — sometimes it’s worse, especially some of PHP 5’s Java-inspired syntax. Mostly, though, I think it’s the lack of closures and blocks, language features that I’ve come to expect and rely on. Peter Williams brings up the same point about PHP.
I first learned blocks and closures about two years ago and now find programming without them mildly painful. I think that Mark Jason Dominus got it right when he said
in another thirty years people will laugh at anyone who tries to invent a language without closures, just as they’ll laugh now at anyone who tries to invent a language without recursion.
There are just so many common classes of problem that are simply and cleanly solved by closures that not having them seems like a crime.
I think I’m holding out for JRuby on Rails.
12 Oct 2006 Sam
Hey,
forgot how I found your blog but I do enjoy some of the info found here. We of course are currently a CF shop (SMSU) and its a wonderful product however I am going to be moving my one of my development environments to php (LAMP) probably this year, for that same single vendor reason you mentioned. I don’t like the idea that I am at the will of a single entity. That and PHP and CF are soooo easy to teach my student workers its just an easy way to go for medium scale dev. with limited to no staff.
-Ryan K.
Hey Ryan, glad you found your way here. I think that PHP and the rest of the LAMP stack will serve you well. It’s becoming more popular with others in the MnSCU system, which I’m glad to see.
What I did not mention is that I have considered CF from a Java EE integration standpoint. As CF is now a Java application running inside a J2EE environment, it has the potential for serving as a nice web interface sitting on top of other Java components. Before its acquisition by Adobe, Macromedia was seriously courting the Java developer (Flex, anyone?) and I don’t see that slowing down. Still, single-vendor, etc.
I also did not mention that I see a future for PHP integration with Java, using a bridge such as you can find from Zend. Not that this matters to you in the least, since you’re probably not doing a lot of work with Java apps.
I know we could make PHP work. I’ve been making it work for years now. All my hand-wringing is really about whether it would be that much of an improvement over Java for our web app development, enough to make it worth putting our developers through. I would have thought so until I started to work with Rails and Django — really, with Ruby and Python, which as languages offer much more dramatic improvements than PHP and which I find so much more pleasant to work with. Still, when I spend weeks working on something that I know I very well I could do in days with PHP, it does seem clear.
I’m curious. Have you looked at Rails, Django, or something of that ilk? Are you using a framework in PHP?
hey Sam. its funny as i was reading the post i was thinking jruby, jruby, and then you called it out…
i am here at Adobe MAX – blogs to come. and i have to say Flex is looking very good. saw a great presentation from t-mobile yesterday, where they used flex 1 to build a scheduling app for employee training which hit an SAP HR back end. very rapid dev.
ruby’s syntax is very very nice though isn’t it. even a fake geek like me can see that.
I was thinking JRuby too, but I’m kind of wondering how those guys will fit into the Ruby community. Is there a published spec from Ruby, or are they going to always be chasing the release to keep up with extensions? Will they choose to implement extensions of their own, and interop won’t be real? Funny timing, as I was thinking about asking this at the CSS Q&A tonight.
There isn’t a Ruby spec, which has been a problem for the JRuby developers, as well as other Ruby implementations. They’ve just had to feel their way around, unearthing all of C Ruby’s quirks. For just that reason, they started a RubySpec wiki, which is picking up steam and I believe is looked upon favorably by the core Ruby devs. I think that Matz has contributed.
As to the interop and fragmentation question, see Obie’s discussion today on InfoQ: How Many Rubies Does the Future Hold?. It is a concern, but JRuby is committed to full compatibility.
You should go to a ruby.mn meeting sometime, Scott. Charles Nutter is almost always there and frequently gives JRuby updates — but let me know if you do, since I haven’t been myself in months and could meet you there.
I confess, my bias and shallow knowledgebase limits me too much. But a Java shop looking for a rapid application development solution?
Flex those ColdFusion muscles.
[…] deployment. I’ve written before how as much as I like Rails, Capistrano, and Mongrel, and as confident as I am that a Rails apps […]