Monday, June 21, 2010

Is Java dying? A response

This is actually a response to an article,  "Is Java dying? Dependency injection and other Java necessary evils", written by my friend Juanfri. Like his article was a response to another article that turned out to be too large, mine started out that way as well. In the end I decided to just post it to my own blog (that way it at least gets some attention).

I must say I liked the original article, but in the end I don't agree with some of it's assertions.

I don't agree for example that there is anything wrong with GWT using overlay types. The code example is disingenuous because it solves a different problem. In fact I have written the same code (using simple-json) this weekend and it's completely similar:


The integration in Ruby is nicer and simpler? Sure, but the mapping provided by GWT sure is useful and the implementation is normally completely hidden from view.

The examples about dependency injection, and his efforts to create a DI framework for Ruby are really funny, especially because they are so recognizable, all of us in this business have gone through the same moments (and will probably still do so a couple of more times during the years that come). Encountering a new technology and then using it for absolutely everything that you come across is normal.

It is the reason almost everything in Java is configured with XML, it was just the way it was done some years ago and will probably still stay that way for some years more. But the whole drive to use annotations shows that people are looking for different ways (and making the same mistakes where suddenly everything uses annotations). And Guice is a prime example where configuration is done using code instead of configuration files. Of course, with the limitations of the Java syntax the result will be less "beautiful" than the same in some other languages.

And finally I also don't agree that there is a huge movement to dynamically typed languages. Instead I would say there is a strong desire to find "The Next Big Thing", in this case "The Next Big Language".

I agree it probably has to do with the fact that Java is already with us for a long time and we have come to know its limitations, 15 years ago it was brilliant, today it's still nice but we know we can do much better.

And of course we know we can do better because there are several examples: C# is already somewhat better (but too similar, not revolutionary), dynamically typed languages like Groovy and Ruby have many advantages (but too messy and too much testing needed for my tastes), or functional languages like Haskell and Erlang that might become essential in the future where having large numbers of processors becomes the norm (but highly functional and therefore unknown to many programmers) and some that try to combine to best features of all like Scala.

Personally I don't really like dynamically typed languages for anything large. It's really cool to be able to work your way into the innards of any object in any way you like but real soon I feel the need to "formalize" in some way what I'm doing, some way of saying "I know what I'm doing, trust me" or even "this is the way to do it, don't try it some other way!".

At this moment I'm trying to learn Haskell and Scala because my "functional side" is really underdeveloped. Scala because it's not so much of a big step coming from Java and Haskell because I want some experience with a language that was made from a fully functional point of view from the beginning. The problem of course is that neither has yet attracted a huge following so I'm not really sure I'll ever be able to use any of them for work. But in the mean time at least I can enjoy learning something new and interesting.

In the end I think "The Next Big Language" doesn't exist yet, but it seems we're all, consciously or unconsciously, waiting for it.

Friday, June 11, 2010

Nexus One: after a few days

So far my impressions of this device are very positive. It's fast, it's very flexible, has loads of options (being a KDE user on Linux probably means I'm one of those people that just loves options) and looks nice to boot.

Like many people have commented all over the world, I think Google should try investing in better graphic and interaction designers for its operating system, Android, because in a first-impressions comparison the iPhone wins hands down in my opinion. The Android interface just seems more cluttered and chaotic and somehow less appealing and intuitive.

On the other hand finally having real multi-tasking is a blessing. Not being constrained anymore by Apple's weird decisions about what you can and cannot do with your phone is even better and the integration with all kinds of Google services by default is just the best part about it all.

But the Nexus One and Android do have some glaring faults. The touch buttons just below the screen are horrible: every time you write on the virtual keyboard and try to hit keys on the bottom row you run the risk of accidentaly hitting the Back or Home keys. That just plain sucks. I've tried an HTC Desire, which is basically the same phone, that has real buttons and it doesn't have that same problem because you need to press them with more force than you normally use for the touch screen.

Another big problem for me as a multi-lingual Dutchman living in Spain is that I very regularly switch languages while writing messages. I might be writing with several people at a time in three different languages and need to be able to switch with a single key-press. Not only is that not possible in Android, it doesn't even let you select a different language than the one you use for the operating system! So either you switch your entire phone from Spanish to English (including all Locale settings like dates, money and whatever) or you disable the keyboard corrections (which doesn't help too much, because I want the OS in English but I need the special keys for the Spanish language!).

But in the end, this being an Android phone from Google (which is definitely not Apple) , I'm sure that the problem can be solved looking around on the Market. Because where Apple says: "you can't do this", Google says: "go ahead, have fun".

So although the new iPhone 4 seems like a nice piece of hardware I'm glad to have "escaped" Apple's "clutches" (yeah, overly melodramatic, but hey, the post is already boring enough).

Thursday, June 10, 2010

Nexus One

Today I got my Nexus One and I decided to do one of those silly unwrapping things, just for shits and giggles.

So this is the box it comes in:


And here is what is inside: