revjim.net

February, 2006:

Java vs. The World

There are a lot of people talking about Ruby/PHP/ASP/Whatever vs. *The World* out there. Over time I’ve realized that for many people it’s natural to claim that whatever you have currently is the absolute best, and that there’s no way anything else can compare, regardless of what you have, what you’ve tried or what else is out there.

However, equal in number, there are those who like to complain that the tool of choice that others are so adamant about is indeed the wrong tool for the job. They point out a features they already have, features you’ll never have, or, when they run out of things to complain about, they just brag about how old their tools are.

bq. PHP and Rails folks take note. ActionRecord (or whatever it is), generated code, and directories that represent apps are so 1996. PHP, hand cranked persistence code is practically as old as C++. This is not where these tools compare favorably with Java’s offerings. And your languages are new. Talk to a seasoned PHP guy and ask them about their code from 5 years ago. Most don’t have code that old, anywhere. — “Matt”:http://crackmonkey.livejournal.com on “Colors of Bikesheds”:http://crackmonkey.livejournal.com/519300.html.

Though it’s been said several times before and in better words than I can present, I’ll point it out again here for posterity: Ruby alone can hardly be considered something to scratch the “web itch”. In fact, like Java, Ruby doesn’t scratch the “web itch” very well at all, it was designed to be much less specific than that. Furthermore, while Python is far more mature than Ruby, the two are often compared in equal light and many Rubyists are Python converts, and vice versa. However, this doesn’t mean that Ruby, Java, or Python can’t handle web development. In the Java world (and forgive me, because I don’t know it all that well) you have Tomcat/JSP and things like that that help Java to get on the web. Ruby has “Ruby On Rails”:http://rubyonrails.com/ for that similar purpose. Python has Skunkweb, among others.

While I don’t intend to argue the advantages and disadvantages to ActiveRecord’s approach to the problem, it certainly isn’t “so 1996″ to me. Maybe Java had some tool that did something like that 10 years ago but, not being a Java programmer, I did not. No, it isn’t /Hibernate/, but that isn’t implicitly good nor bad. It’s just different. If Hibernate was around 10 years ago then that’s great. I wish I was using it 10 years ago when I had nothing else. If I was programming in Java and Hibernate was the right tool for the job, I’d be using it today. But I’m not.

As far as directories that represent applications go, I don’t understand the complaint here at all. I’ve used plenty of Java code before. The “libraries” go in the library directory (just as they do in Ruby, Perl, PHP, and Python) and everything else goes with the application. Some programmers are inclined to put all of the functionality into a library and simply call it from a single file application. I rather like this approach but the code is still separated into directories. Those directories just all sit under the libraries directory now, instead of under the application directory. Ruby On Rails works this way. The actual “web deployed” code is a directory with a single file in it. Sometimes there is a bit of code to hook it into the webserver of choice or, in some cases, *BE* a webserver, depending on how you choose to deploy it. Of course when serving a web application there are often auxiliary files (images, stylesheets, etc) that come a long with it. Some people store those in other ways but, for simplicity, most people include those in the deployed directory as well, though you certainly don’t have to.

I have lots of code that’s 5 years old. I even have some PHP code that’s 5 years old. I’m not really proud of that fact, but it’s not something to be ashamed of either. It just is.

You are right about one thing. Most of the languages you’ve mentioned are indeed younger than Java. And I have a great deal of appreciation for a language and a set of libraries that are old enough to have all the bugs worked out and be considered tried and true. But Java’s been moving forward all of this time and so have its tools. So unless you stick with the same versions you were using in 1996, you’ve got a chance of running into an “undocumented feature” regardless of what language you’re using.

What were you doing using Java 10 years ago anyway? It was *SO YOUNG*! And the tools it had were so immature compared to what C++ had at the time. Of course my question is rhetorical. I know why you used Java: It got the job done in the best possible way: best for what is important to you and your application. That’s the same reason you use it today. And this is the same reason I choose the tools I choose. In certain situations, Java might just be that tool. But not today.

Could Typo Be the Problem?

If it wasn’t known to you before now, this website currently runs Typo, a blogging CMS on the Ruby on Rails (RoR) platform. Lately I’ve been pretty frustrated with the amount of trouble my site has been giving me. Cached files are problematic, ruby processes are kicking and screaming causing high server load, an Application Error message is shown randomly and without reason, even something as simple as hosting a single file for download is a lot more complicated than it should be. At first I thought the problems were my fault. But, as I began to see similar issues on other websites running Ror, I began to believe it to be the culprit. But now, I’ve refined that a bit more.

I think the problem may lie in Typo. It wasn’t until this morning when I realized that a large portion of a certain feature was completely overlooked that I started to realize that maybe it could be part of the problem. I initially embraced Typo, partly because the RoR site did, and partly because it was the only “polished” RoR weblog application. Now, however, I’m starting to feel like maybe that jump was premature.

Some of Typo’s features are only half implemented leaving a confusing model and table structure behind. Others are very poorly implemented. Some aren’t implemented at all. These things make modifications difficult because a lot of needed changes are in the core. But modifying the core too much would result in the inability to easily incorporate future enhancements from the Typo upstream. So I’m left with four options:

# Just wait for Typo to make the changes I desire.
# Fork the Typo code and start my own improved branch.
# Embrace another RoR blogging engine.
# Use WordPress.

I’ve already modified the Typo source for use on “my Photography Site”:http://djamesphoto.com/ because the Flickr library included with Typo was not as useful as I needed. So, I could always use those modifications and enhancements as a starting point to forking the Typo code.

Of course, using WordPress means using an engine with a lot of working features, a large userbase, and a bunch of developers: all good things. However, that would mean programming in PHP again (and I really love Ruby) as well as dealing with source code that I’ve already decided that I don’t particularly care for.

The Shoebox: Episode 0001

Jess and I have decided to start a podcast of our own. We will certainly still be doing Gentle News Live! every Tuesday night at 8:31pm. Our intent is that this will be a completely separate show with a different 20:3atmosphere that will be more directly influenced by Jess and I.

This is our very first episode recorded just last night. It’s not at all a polished show, so don’t expect anything like that. We’ve got some ideas to work through and some hurdles to jump over. We’d just been talking about it for so long that we realized if we didn’t get *something* out soon, we’d never actually get started on it. We don’t have a website. We don’t have a feed for your iPod. We aren’t registered at PodcastAlley. We don’t even know if there will be an episode 0002.

At this time, we’re hoping for 2 twenty-ish minute episodes each week. As we move forward, that will most certainly change. Additionally, we’re considering doing some or all of the episodes Live (where we broadcast as you listen).

We’d love to hear your feedback.

“The Shoebox – Episode 0001 – 21min 52sec – 20MB – MP3″:http://revjim.net/shoebox/shoebox_20060203_0001.mp3