if ( document.comments_form.url ) { document.comments_form.url.value = getCookie("mtcmthome"); } Otaku, Cedric's weblog: May 2007 Archives

May 31, 2007

I, for one, welcome our new offline AJAX overlords

Werner Schuster is making a few interesting remarks about Google Gears and how concurrency is implemented in Javascript. However, I'm quite puzzled by his following statement:

I still hope that AJAX will die a quick death, like Java Applets, just for being so damn ugly and horrible to implement.
Mmmh... AJAX ugly? Are we talking about the same thing?

AJAX is just the underlying medium. It's a loosely defined set of language and design constructs that make it possible to fetch data asynchronously while displaying an HTML page. It's like oil in your engine: it's dirty and smelly, but you couldn't get anywhere without it and if you're not a mechanic, there is very little reason why you should ever have to manipulate it.

Werner is probably referring to the pages themselves that are using AJAX behind the scenes, and there is obviously not much that can be done about this UI problem except wait for the market (and the UI designers) to mature and get comfortable with this new paradigm.

As for AJAX being horrible to implement... well, not any more.

Yes, the low-level details are ugly, but you can't expect any less from a foundation API. The early days were tough for programmers, but nowadays, there is really no excuse to reimplement another browser-neutral XmlHttpRequest layer. Whatever you want to do with AJAX, you can now do it in the language of your choice, and for each language, you easily have a handful of different toolkits at your disposal.

The way I look at it, AJAX is a liberating technology. I can't wait to see what kinds of products await us in the next few years, and I certainly hope they will be built upon AJAX while allowing me to get work done while off-line.

Posted by cedric at 02:55 PM | Comments (14)

May 22, 2007

"One laptop per child", as long as they buy it from me

I've been a big fan of the "$100 laptop project" ever since Nicholas Negroponte made it public. The idea that tens of thousands of kids and adults located in remote and poor areas of the world will get a chance of being exposed to computers and the Internet for such a cheap price struck me as one of the best charity ideas I heard in a long time.

Negroponte has had to face numerous challenges along the way, and even until very recently, there were still a lot of people claiming that the project would never succeed.

They were wrong.

The laptop finally happened, and even though the price ended up being more expensive than initially announced (in the $160 range), the computer is real (I played with one) and is now beginning to ship to countries interested in buying them in batches. And of course, its price will decrease in the coming years.

Intel recently announced their own laptop initiative which, of course, will run on an Intel processor, as opposed to Negroponte's computer, which uses an AMD. Initially a very strong opponent of Negroponte's project, Craig Barrett, Intel's CEO, made an about face and decided to put his company behind a similar effort.

It all sounded great to me. The more computers for the kids, the better, right?

Negroponte doesn't seem to agree and he's now accusing Intel of trying to drive him out of business:

Intel should be ashamed of itself.
What's even more shocking about Negroponte's stance is that "One Laptop Per Child", the foundation he created for this project, is purely non-humanitarian and non-profit. How can he then justify his hostility toward a project that would make computers available to even more children than he had ever dreamed of? Is this a case where personal pride is taking over charity goals? Does he prefer to go down in history as a disgruntled first mover instead of the inventor of the $100 laptop?

I can understand that he might be angry at Intel for trying to derail the project in its early phases, but isn't there a picture that's greater than these two men?

What's the worst that can happen? More computers at a more affordable price?

Come on, now. Just think of the children.

Posted by cedric at 05:30 AM | Comments (22)

May 20, 2007

Buttered

I wonder if we're not attending the birth of a new meme...

It started with this guy angry because his roommate would slam the door every morning at 6am as he left. He decided to teach him a little lesson by buttering the floor of their apartment...

A few days later, his roommate received a link to the video and decided to repay in kind...

Not to be outdone, the original prankster retaliated...

Can't wait to see the next round.

Update: fixed the links.

Posted by cedric at 10:58 PM | Comments (4)

May 14, 2007

Yes, please restore my sessions

Have you ever seen this window?

It's one of my favorite Firefox dialogs: it lets me restore all my windows and tabs when Firefox starts. Like most users, I usually have a constant set of certain windows (emails, blogs and a few other informational sites that I consult throughout the days) along with incidental windows depending on where my web surfing takes me.

There is one tiny problem with this dialog, though: I just don't know how to configure Firefox to display it.

The only thing that seems to work is to kill the Firefox process.

Does anyone know a way to configure Firefox so that my windows and tabs are always saved when I exit?

Update: Thanks to Rob for the answer in the comments. The setting is hidden in the about:config panel.

Posted by cedric at 08:51 AM | Comments (11)

May 08, 2007

The JavaFX disaster

I'm trying to understand what JavaFX, which Sun just announced at JavaOne, is about. So far as I understand, it's a scripting language designed to make it easier to create user interfaces. Okay, fine, but it's still a bit vague, so I turned to the FAQ, and in particular, to two questions that were the most relevant to me:

Why do I need the JavaFX Script? Isn't Swing good enough?

There's nothing wrong with Swing. Swing is one of the best GUI development toolkits of its kind. Swing makes it very easy to create standard GUI components, buttons, listboxes, trees, and tables. Together with Java 2D, Swing makes it easy to customize existing components or to create new custom components to achieve virtually any desired visual effect. Sun is not replacing Swing with JavaFX; instead, JavaFX Script makes Swing much easier to use. With the new JavaFX Script language, the structure of the programmer's code closely matches the actual layout of the GUI, making it tangibly easier to understand and maintain.
Ugh... Well, can I have a real answer now? Isn't Swing good enough? There is absolutely no explanation why they are inventing another layer (or is it a new UI? I still don't know at this point, despite reading the FAQ twice now).

No answer?

Alright then, let's turn to the second question that's burning in my mind:

Why isn't Groovy enough?

Groovy and other languages have two specific traits which don't precisely meet these needs, namely that they are generic in nature and don't provide the appropriate abstractions necessary to optimize the UI design process and similarly are designed specifically for programmers other than content authors.
Are you kidding me? "Generic in nature"? What does this even mean? Do these people even know about Groovy? Or about the SwingBuilder and other MOP-inspired constructs that you can use in Groovy to make the declarative/imperative impedance mismatch all but disappear?

If you're going to explain why you didn't pick Groovy in an FAQ, there are plenty of reasonable justifications you can come up with (memory footprint, dependencies, etc...). But... *that*?!? Come on.

Looking at the examples further, I see code snippets that are actually a severely crippled version of what Groovy can do. JavaFX appears to have some scripting abilities but it's yet another language with its new syntax and rules. For example, the symbol for inequality is... <>. That's right, <>! I'm guessing the creator of JavaFX likes Eiffel. Too bad the rest of the world hates it.

By the way, can we have full code completion, code browsing and folding in our IDE for this new language?

More than frustrated by the FAQ, I turn my attention to the demos and tutorials and I start to read. And here is the kicker:

Before you begin, you must install the following software on your computer:
* NetBeans IDE 5.5 (download)
* JavaFX Script plugin for the NetBeans IDE 5.5 (download instructions)
That's right: you need NetBeans to run JavaFX.

And suddenly, it all makes sense.

Desperate to get developers to adopt NetBeans, Sun has found another way to try and lure them: invent another framework, come up with a few reasons to justify its existence and in the tutorial, mention in passing that you have to download NetBeans to even write a Hello World example.

Look, Sun: JavaFX is a simple library. A jar file. A bunch of class files. I'll be happy to add javafx.jar on my class path and import javafx.ui.* (although... it's a highly non-standard import name. Did you forget the convention that you helped define?... How about org.javafx?).

But tell me again: why are you forcing me to use NetBeans?

Sun needs to understand that we, Java developers, are not satisfied with just using an open source version of Java: we hate proprietary lock-in. We want choice. And we want Sun to respect the choices that we made to write our Java code and acknowledge that not everyone (actually, very few of us) are using NetBeans.

The timing of this announcement is quite interesting actually, since I was telling a friend just this morning that I was sad to see that despite his active blogging, Jonathan Schwartz never *ever* says anything about Java. Most of his blog posts are about Sun strategy and marketing material, and it's been obvious to me that Java stopped being Sun's priority a long time ago. This morning, I fire up my trusted Google Reader and I see that Jonathan is talking about Java! Not that this comes as a surprise: this is, after all, JavaOne week.

But breaking the year long no-Java-mention embargo on his blog by introducing JavaFX is a sad reminder that Sun does, indeed, care very little about Java.

Posted by cedric at 09:58 AM | Comments (52)