Sun Debuts JavaFX As Alternative To AJAX 441
r7 writes "Internetnews is reporting on Sun's introduction of JavaFX at JavaOne today. Looks like a combination Applet, Flash, Javascript, and AJAX with a friendly programming interface. Does this really spell the end of AJAX? I sincerely hope so. Nothing built on Javascript will ever achieve the security, cross-platform reliability, and programmatic friendliness that Web 2.0 needs. Proprietary solutions and vendor lock-in are also dead ends. JavaFX has the potential to satisfy this opportunity even better than did Java over a decade ago. Along with AJAX, let's hope JavaFX also puts paid to Microsoft's viral Active-X and JScript, and, more importantly, that it really is a web scripting language that developers can grok."
Have they fixed the startup time? (Score:4, Insightful)
It has been found that people give a web site about 2 seconds to respond before they determine it is not going to load and surf away.
Proprietary solutions & vendor lock-in (Score:5, Insightful)
AJAX Going Away? Oh noes! (Score:5, Insightful)
Did it occur to you that you're sounding exactly like the hype you're decrying?
AJAX is a stupid name developed for the ole' hype machine (mostly to sell conferences and books, methinks) but the basic web technologies behind it are NOT THAT BAD. To use the example from the article, am I "tearing [my] hair out over as [I] attempt to get the JavaScript working in both Internet Explorer and Firefox?" Actually? No, I'm not. And I just implemented a Comet [wikipedia.org] library in both Javascript and Actionscript. About the most frustrating thing was the fact that Opera ignored the cache-disable commands when using XML.load in Flash. So I build a solution into the library. And if you think that's fun, wait until I detect Server Side Events in Opera and use XMLSockets in Actionscript!
*shrug*
Oh, and I had to dynamically patch Safari and Opera to add support for the toSource function. Easy as for(var i in object) pie.
The problem with most "AJAX coders" is that they still think of Javascript as that cutesy language they used to do scrolling statusbar text with. But it simply isn't that bad. In fact, Javacript is a full-up, Object Oriented (or at least, OOP capable) langauge that fits the lightweight needs of the web browser perfectly. Java is a 600 pound gorilla that's better for designing heavyweight applications that are secure, robust, fast, and feature complete. The two target very different markets.
As for JavaFX, there is (if you'll excuse the expression) "nothing to see here". It's just a Silverlight competitor. Which makes it just as questionable as the product against which it's competing. If you really want a replacement for XMLHttpRequest, use XMLSocket [devpro.it] instead,
Proprietary (Score:2, Insightful)
Or... not.
Using Java solutions over
Re:Have they fixed the startup time? (Score:5, Insightful)
End of Ajax.... (Score:5, Insightful)
And there is so much big corporate inter politics involved with each side rallying their alternatives that it looks like we are stuck with the lowest common denominator, that beeing for the moment javascript.
We're all switching to Java (Score:1, Insightful)
Re:Hmm (Score:5, Insightful)
Actually, ActiveX is a patented Microsoft Security Hole(TM) big enough to drive a Mack Truck through. Effectively, Microsoft looked at Java Applets and said, "The biggest problem with it is that it doesn't access Windows APIs and has all that security BS. We can do better." Next thing you know, Microsoft "partners" are showing how you can access DirectDraw and Direct3D to make ActiveX components that were WAY more impressive than the simplistic animations that Java was capable of. Of course, the security implications hit Microsoft less than a year later as Malware started exploiting the system for all kinds of nefarious purposes.
Microsoft kinda-sorta shuffled it off into other areas after that. Now they're back with a vengence. Silverlight will be everything that ActiveX was going to be, but BETTER! Can you feel the excitement?
Re:AJAX Going Away? Oh noes! (Score:3, Insightful)
Java Script isn't so bad! Sure I had to patch browsers and write a different version for each one. I made my own library and blah blah blah.
Sounds bad to me. Javascript is very annoying, mostly due to the incompatibility between browsers, but for other factors as well. I welcome this. And how do you know JavaFX will be so bad when they have only announced it and haven't previewed it? Worst case scenario, it feels like using the Google Web Toolkit but doesn't produce large .js files that you have to include. It isn't going to run the full Java VM and load up support for all the little libraries (OpenGL, sound, etc). It's designed for this, I'm betting it will be rather speedy. It will certainly be up there with Flash.
This sounds like it is targeting more than just "fetch this list box dynamically" by trying to be a way to make web pages that are currently only realistically implementable by making the entire thing in Flash.
Also, Javascript may have gained abilities over the years (like OOP), but Java has had it from the start. Java has the ability to do static typing. OOP isn't bolted on. It wasn't an afterthought.
Note: after reading your post once or twice, I'm having a hard time telling if the whole thing was sarcasm or not
A temporary solution? (Score:5, Insightful)
I don't claim to be an AJAX expert, but it seems really good for the simple things you need to do. You can find 10 libraries now that give you collapsable boxes, drag-n-drop, etc. But it gets much more complicated if you want to do something not covered with these libraries.
The big problem being that put very simply: HTML was not designed for full-fledged interfaces. Compare against a beautiful library like Cocoa, and it falls very very short. Which is fine. It's great for what it does.
Java is many ways was supposed to fix this problem. A method to create interfaces that can be spread through web pages. But issues besides just speed have been a problem with Java. AWT was not great for making interfaces, and Swing isn't (IMHO) much better. I haven't tried SWT, but even Eclipse, its flagship, suffers from all types of interface issues (compare it against an IDE like XCode).
I'm trying very hard not to be an Apple fanboi. I've used PCs for most of my life, and Linux for a good enough time (> 10 years). But I've seen enough interface libraries now (GTK+, KDE, Windows API, Javascript hacks, various ones using SDL, etc.) that I've seen both highlights and major downfalls from the different design paradigms used.
One of the largest design issues I've seen comes from at the end of the day from the language itself. Part of A large part of Cocoa's beauty derives from Objective-C. It does things that c++ wouldn't dream of doing for speed reasons. Both Gtk+ and KDE try to replicate features already in Objective-C, but because they are non-native, they don't/can't do it as well. Which is not to say Objective-C is the end-all be-all language -- it's just great for interfaces.
It's also something that from my personal experience Java can't do. So it's hard for me to imagine how using Java to make an interface for web pages will be a great advancement (again, I'm leaving speed issues alone -- this is a purely design argument). And maybe it will be better than AJAX, but that's not a great advancement
Re:Hmm (Score:1, Insightful)
If you mean slow by startup time on low speed platforms, Java does lag behind a bit. However also announced today, is that sun is working on a micro-kernel for the JVM that will only load and install classes that are used by the runtime. They had some MB numbers, many common java apps had their initial memory footprint cut to 1/10th. Once this happens, JavaFX will load faster than flash, open source, be more portable and easier to code against. It will be used natively on phones, desktops and PDAs.
So I would think if you are for open software and are a developer, you certainly would want JavaFX to take off. Given its scope there is no current alternative anyway. Unless you are JavaOne (like the me) and seen the demos and spoken with the actual developers, it would be very hard to understand what JavaFX really is. Comparing it to AJAX is not accurate. Its an optional wrapper for swing that works in rich clients and flash like applets. FX apps might still employ AJAX depending on what you want to do.
Sorry, had to quash the disinformation.
Re:ajax just works (Score:3, Insightful)
Re:Have they fixed the startup time? (Score:5, Insightful)
It's just confusing to them.. and it has a negative effect on performance when they fiddle with it.
More importantly, it's a change to their desktop which happens outside the browser window in response to going to a web page. Users don't really understand that it is the browser that spawned this.. they think that it was the web page that spawned this, and they understand that web pages shouldn't be able to put icons into their systray.
All in all, it's a dumb idea.. and Sun should have done some user testing to see what the user's reaction to it was.
Re:Have they fixed the startup time? (Score:2, Insightful)
Actually, it's four seconds [bbc.co.uk], but what the hell, you're only off by 50%.
Re:Have they fixed the startup time? (Score:3, Insightful)
As far as I can tell, Sun never did that for Java.
Re:AJAX Going Away? Oh noes! (Score:5, Insightful)
Also, OOP is not bolted on in Javascript. It's been there since nearly the beginning. It's just that 99% of web coders never actually learned how to code Javascript.
I've been a Java programmer for about 11 years. In that time, I've explored the VM and libraries inside-out, upside-down, and sideways. The conclusion I've come to is that Java in the browser is a bad idea. At least in the form of the J2SE. If it had been developed more like a J2ME plugin with access to the DOM, it might have been a decent replacement for Javascript. But it wasn't developed that way, and now I think it's not in a very good position to compete in that space.
You bring me requirements, and I'll show you the magic that modern web technology can perform. And it's only going to get better. My comments about Server Side Events and XMLSocket are meant to mention how much better it's going to get. SSE will effectively obsolete Comet-style requests, resulting in rich server "push" systems that can transmit nearly anything to the client on demand. No need to worry about different XMLHttpRequest implementations, it will all be automatic in the browser. Opera already supports this, and thanks to the magic of Javascript, it's easy to branch to code that makes use of it when available. Wrap it in your libraries, and you're ready. to. ROCK!
Which is its strength as a platform, and its weakness as a scripting language. Don't get me wrong, the computer scientist in me wants to go with static typing. I love static typing. It makes all the bad problems go away. But the web coder in me knows that distributed document technology needs something more flexible. Dynamic typing as in Javascript is that flexibility.
It's slightly out of date, but you might find this article I wrote [intelligentblogger.com] to be interesting. Web technologies are really accomplishing what Sun envisioned all those years ago.
Re:Proprietary solutions & vendor lock-in (Score:4, Insightful)
Is the JVM really less "heavy or overkill" than Flash?
Stupid branding. (Score:5, Insightful)
Sorry Java, you're not nearly as important as you think you are. QuickTime commits the same set of sins, which is why I swear by QuickTime Alternative, it is a bit less annoying.
Re:Have they fixed the startup time? (Score:5, Insightful)
* Static strict typing, that throws a runtime error if you try to cast to an incorrect type
* Compiled into bytecode, with a JIT runtime
* Cross-platform (windows, mac, linux and solaris)
I disagree so strongly, I finally made an account! (Score:5, Insightful)
Security - Javascript is NOT designed to secure a web app, security needs to happen on the server side, out of necessity!
Cross-platform - I would argue that Javascript / ECMAScript, having been standardized and distributed with all major browsers for years, is arguably the MOST supported cross-platform programming language in the world. If a computer has a browser made in the last 5 years, it supports standardized ECMAScript. And what PC doesn't have a browser?
The only incompatibilities I run into on a frequent basis are getting my scripts to create results that look the same across all browsers, and that's not Javascript's fault, it's CSS and browser support of CSS! If you have problems with the [i]functionality[/i] of Javascript, then you're probably not writing according to the well established standards, or worse yet, throwing together snippets of Javascript from all over the web like so many amatuers that give the language a bad rep.
So you would use Sun's solution, rather than the well established internationally standardized ECMAScript?
Programmatic friendlyness - Joel says it all here [joelonsoftware.com] Personally, I've programmed in dozens of languages, and few are as flexible and enjoyable as Javascript
Javascript used to have the same status that Java applets and Flash still do, used predominantly for play things, small self-contained segments of the browser where you want to do something different. Javascript has risen above that. The world is finally realizing Javascript can be an integral part of an entire website, and that the website as a whole can be enhanced by Javascript and it's tight integration with other web standards.
This article sounds like an attempt to rehype Java applets, which frankly, have not seen the advancement and acceptance that Javascript has over the years.
Re:Have they fixed the startup time? (Score:4, Insightful)
Re:Have they fixed the startup time? (Score:5, Insightful)
Re:AJAX Going Away? Oh noes! (Score:1, Insightful)
Re:Have they fixed the startup time? (Score:5, Insightful)
Re:This begs the question... (Score:5, Insightful)
Re:Have they fixed the startup time? (Score:1, Insightful)
Re:Have they fixed the startup time? (Score:3, Insightful)
Sure, that's why AOL wasn't successful in the dial-up era, unnamed monopolists prevented them from sending out install CDs or making deals with computer companies. Oh wait
Re:Have they fixed the startup time? (Score:4, Insightful)
What useful content is going to be rendered while the applet loads? It's like saying Window's boot time isn't problem because you can watch the Windows logo while the OS is loading.
Re:AJAX Going Away? Oh noes! (Score:3, Insightful)
I suppose that maybe you were being facetious or sarcastic, or maybe you were simplifying, but static typing hardly "makes all the bad problems go away". Unfortunately, I don't remember who originally said it, so I can't properly attribute it, but, paraphrasing, "static typing is the compiler doing some cursory testing on your code". To raise your level of certainty that your programme is bug-free, you have to do a lot of testing. If you use a statically-typed language, then the compiler will do some testing for you--it'll tell you that every time you call a function, the arguments you pass are the correct type and the return value is stored in a variable of the correct type. It won't tell you whether or not your code contains a logic error. Passing the wrong object to a function is an error in the programmer's reasoning that is, arguably, akin to the traditional kind of logic error that compilers gleefully use to generate segfaults and buffer overruns. To catch these sorts of things you need unit tests and integration tests and the whole shebang.
I think, in the typical case of Javascript in the browser, the fundamental problem is the combination of incompatible implementations, the piss-poor development environment, and the apparently widespread belief that you can write Javascript code by cutting and pasting. For anyone interested in improving their Javascript development environment, I recommed the Venkman debugger [mozilla.org] (or Firebug [getfirebug.com], but I've never used it) and Selenium [openqa.org]. Venkman (and, apparently, its heir, Firebug) provides a real, honest-to-goodness debugger that supports breakpoints, watchpoints, stack traces, etc. Selenium is a tool for running unit tests within all of the major browsers and it can be automated. (In a past life, I had a script that fired up a virtual X server, launched IE through Wine and ran tests on my app through Selenium. I plugged this into cron and had regular reports of the output emailed to me.)
Ian
Re:Netbeans (Score:2, Insightful)
Re:AJAX Going Away? Oh noes! (Score:4, Insightful)
Javascript is a pretty awesome language once you strip out all the web browser DOM stuff. I've used it as an embedded scripting language in my own applications and was very surprised by its capabilities.
Re:Have they fixed the startup time? (Score:3, Insightful)