• The F in JavaFX

    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.

    Friday, July 10th, 2009 at 10:54
  • Saturday, July 11th, 2009 at 03:21 | #1

    Though words, but your opinion is worth reading. I know that JavaFX docs being hard to search or the read (I think you refer to list of packages and description of method being collapsed, right?) issue is being worked on.

    Every language has its quirks and bugs as every man has it preferences. For example I don’t quite find ()?: more readable than JavaFX’s if then else, but it is a matter of preference.

    How do you like binding and animation facilities in JavaFX? New Caspian look is also worth checking IMO. I also find declarative and yaml nature of JavaFX Script nice to have. It is so much less visually noisy to XML. Sequence’s select from where is also interesting. There is some valuable stuff in there. It needs polish and refinement for sure. And many think it is a FAIL, EPIC FAIL, too little, to late, but so are many people thinking about PHP or Java, or any other “dead” language. I don’t like the F word, but I like that you present you opinion through technical reasons – this way you give constructive feedback and this can only be good.

    About the NetBeans supporting JavaFX issue – it was a matter of priorities (Java One was just around the corner and they wanted to make a release with a tool shipped, not in beta) and resources (JavaFX team is working hard and so is NetBeans and they can’t do everything instantly).

    Let’s hope JavaFX will continue to evolve to sweeten itself.

  • Saturday, July 11th, 2009 at 11:45 | #2

    Large post you post only with negative aspects. Simple strings can in JavaFX be very more productive than in Java:
    var s = “Welcome: {user.login} \n at {config.date}”;
    or
    var s = “{if(good) item.answer else property.tryAgain}”

    I have worked with JavaFX and work some demos/application and doesn’t have problems with API or strings.
    About % and ()?: – “%” i used that and I agree that this is common and useful. “()?:” was newer used by me… sincerely, maybe the reason is that I am a student and many times I was helping frinds with them programs and if() else is much more readable and undestendable to me and always to them.
    Idea of Your post(to me) is something like: “It doesn’t have % and ()?: and hasbad API, it must die…” Post if I wrong. Bad API doesn’t mean that technology will fail, I think that JavaFX will not be most common RIA platform, but eventually it replaces Swing, it will be used as front for java applications(when it will be more stable, better audio/video and many more…) I’m quite sure that with JavaFX authoring tool JavaFX become much more popular, and sometimes replaces Flex.
    I don’t like xml to building UI…

    Sory for my english, also it is morning and I doesn’t drink coffe yet:)

    Regards,
    ps. I think your post is very good :)

  • admin
    Saturday, July 11th, 2009 at 12:33 | #3

    Thanks krzychukula, warjan for your comment there is more to this than the mod and the conditional asignment. Sun made a series of strategic mistakes (well blunders really) with JavaFX. If you look at the posts linked to from this one, you will see them. As for things like var s = “{if(good) item.answer else property.tryAgain}”; PHP coders have been doing that sort of thing for more than a decade. JavaFX borrows heavily from PHP and Javascript. If they had done a verbatim copy PHP developers whould have taken to it like a duck taking to water but by copying bits and pieces and making a stew they have made it difficult for everyone.

    Animation facilities, again this is something new for Java programmers but Flash had this sort of animation even in the mid 90s and you could easily combine it with ActionScript to do the sort of things JavaFX can do now.

    Last but not least on the matter of priorties, if JavaFX isn’t a very high priortity for Sun, how can you expect software development companies to prioritize building JavaFX teams? http://www.insideria.com/2009/07/flex-silverlight-job-trends.html

  • Saturday, July 11th, 2009 at 18:57 | #4

    I haven’t said JavaFX isn’t a priority for Sun. I’ve said the lack of JavaFX support in 6.7 is result of prioritizing 1.2 release for Java One. The fact that JavaFX borrows heavily or not from other languages is hardly a disadvantage – you can’t create anything now that doesn’t borrow ideas from the past creations. If they had a verbatim copy of PHP many developers wouldn’t want to look at JavaFX for this very reason. And it wouldn’t make sense otherwise to mimic server side scripting language for desktop environment.

    And about the links in this post:

    1. It is obvious that Sun released JavaFX for dominant platform and put Linux and Solaris on the side. They needed to get a release quickly and done it. I think Windows and MacOS X cover 98% of the market leaving 2%. It’s pure math.

    2. Yeah, the graph says it all. There is no big demand for JavaFX jobs now and there probably won’t that much of jobs in near future. But to make things clear – JavaFX didn’t officially existed before the end of 2008 marking 1.0 release.

    And on the side note, could you do something with comments system to allow breaks for paragraphs?

  • admin
    Saturday, July 11th, 2009 at 19:44 | #5

    Silverlight and flex and all other technologies make betas available so JavaFX only being made available in late 2008 doesn’t apply. The whole point of my previous posts is that targeting the 98% is a huge mistake. People on Windows and OS X are two heavily tied in with Adobe and M$ technologies they are simply not going to bother with JavaFX (the statistics (it’s statistics BTW and not pure math) proves it).

    Point taken about the comment system needing paragraph breaks! :-)

  • admin
    Sunday, July 12th, 2009 at 18:08 | #6

    It’s your life, you have the perfect right to waste it on a still born technology like javaFX

  • Wednesday, July 15th, 2009 at 13:13 | #7

    I have watched many of Sun’s failed attempts to handle and process digital media over the last 12 years and I see JavaFX as another example of “Epic Fail”.

    Rather than address all of the thousands of problems and bugs concerning video, sound, imagery, rather than fix the applet (freezing) issues, they chose to build on top of the mess and hope that this would somehow usurp Flex/AS3. I mean come on, what sort of ganja are they smoking down there in Santa Clara?

  • Eric Buitenhuis
    Wednesday, July 22nd, 2009 at 06:20 | #8

    Although JavaFX in a browser relies on applets, since Java 6 Applets no longer run within the browser itself but on the machines JRE, I don’t think it’s fair to say it’s built on the same mess. It may be a new mess, I’m still undecided (but very happy with 1.2 so far). However, that’s why you can drag a JavaFX app onto your desktop, cache it on your machine, etc. In theory it just uses the browser as a launchpoint and not as a runtime environment. Correct me if I’m wrong, but I think that’s the deal, which I think is very significant.

  • admin
    Saturday, July 25th, 2009 at 09:57 | #9

    you will be a lot happier if you switched to adobe air.

  • Wednesday, July 29th, 2009 at 08:01 | #10

    I started looking at JavaFx in May 2009 when I wanted to migrate my application from Ajax/DHTML to RIA and the road has been truly difficult.
    Well 1.2 is a great improvement over 1.1/1.0. I can also use my Java classes in JavaFX which is really great because then I can do all the multi-threading behind the scenes which was not possible with Ajax/Javascript.

    However, there is still much more needed to convince people to commit to it.
    1. Great IDE where you can drag and drop controls onto your surface. I suggest they go and see the Borland guys. Very good IDE guys.
    2. More controls (BorderLayout, Tab Layout, DataGrid, Fill layout, Group box, custom combobox etc)
    3. Better documentation and more sample code.

  • admin
    Wednesday, July 29th, 2009 at 09:17 | #11

    If you already have an application in Ajax/DHTML why are you even looking at Java FailedX? Just uninstall it (and uninstall netbeans while you are at it) and install adobe air. Adobe Air is mostly DHTML and Ajax. You only need to migrate your server side code, even that you can avoid buy exposing a webservices API.

  • Wednesday, July 29th, 2009 at 22:23 | #12

    I needed multi-threading support and that was available to me through Java/JavaFx. If Adobe AIR can truly multithread, then maybe I will consider it.

  • admin
    Thursday, July 30th, 2009 at 06:43 | #13

    I am not sufficiently experienced in Adobe Air to comment on the multi threading at the moment. However for most apps/webapps/applets the reason you need multi threading is to prevent the UI from freezing up when you are carrying out tasks like retrieving content from remote locations. With adobe air, Database queries and web requests can be asynchronous so you probably don’t need to create any threads on your own. Then there is the tried and tested XmlHttpRequest.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
1 trackbacks/pingbacks
TOP