The F in JavaFX

2009 July 10 at 05:24 » Tagged as :jquery, javafx, ctc,

Recently, Netbeans 6.7 was made released without support for JavaFX this is perhaps the first tacit admission by sun that JavaFX is a failed technology. They are acknowledging that most of the netbeans users are using it for java and for PHP but not to develop JavaFX scripts. Netbeans 6.5.1 does support JavaFX but with bugs. It's difficult enough to sort out the bugs in your own code but when you have to fight the IDE it's no fun at all. There is no doubt that JavaFX is a failure. Much as been written about it including how sun didn't get their strategy right, how there are   precious few searches in google for javafx (see an analysis) and so on. The language itself has loads of probles. For example. JavaFx doesn't have a % operator. Sure you can still calculate a modulo by using 'a mod b'. But sun was hoping that Java developer would embrace JavaFX so why make things difficult for them? Similarly it does not have the ternary operator. If you want to do a conditional assignment you need to do this:

a = if( condition) value1 else value2

This is again something that is eminently forgettable and certainly less readable than the more familiar format:

(conditional) ? value1 : value 2

Popular languages are popular because an experienced developer can switch from one to another with the minimum of effort. You don't need to RTFM every effing detail. Expressions that work in one language works in another. In JavaFX you need to look it up - now that wouldn't be so bad if the manual was readable , but it's nightmare to find anything in that ajaxified API doc. Worse still stuff like operators and syntax are not described there but there is a separate poorly organized document for that. There's no switch case yes who ever heard of a language that doesn't have switch case? Well I have, perl! so let me rephrase that, whoever heard of a modern language that doesn't have switch case. Heck even VB.Net has switch case  (though they have called it Select Case (what can you expect from Microsoft?)) Support for String manipulation in JavaFX is minimal to say the least so you are forced to rely on the java String class and it's methods but some of those methods return 'char' primitives and you cannot do any comparison with the return value. That's because both single quotes and double quotes are treated as Strings where as in Java single quote is used to identify a character. so for example the following code will fail

if(s.charAt(0) == "[")

The interpreter will tell you that you have "Incomparable Types: Character and String". Interestingly, even though the intepreter speaks of a Character type you don't find one listed on http://openjfx.java.sun.com/current-build/doc/reference/TypeChart.html  ! Some of the bits and pieces seems to have been borrowed from Javascript/Jquery, others form PHP other from Java and they have been tossed into a can and stirred till a most indecipherable soup emerged. So if you want to make a falling brick game or an Image Viewer JavaFX is the right language to use.  If you want to do something serious, you better look at other options.