Flash – The new Java?

Update: After hearing about some misunderstandings regarding this post, I want to make sure, that the title “Flash – The new Java?” is of course targeted at front-ent software engineering, not backend. Although it’s obvious that noone would ever try to build a web application backend using Flash, I just wanted to make sure that you understand what I am talking about :-)

Flash/AIR seems to really become a serious alternative development environment if it comes up to multi-platform requirements for desktop- and mobile applications.

With one codebase (in ActionScript3), it’s possible to target:

  • Windows
  • Mac OS
  • Linux
  • iPhone, iPad
  • Android
  • Web OS

Don’t missunderstand me. If I say “desktop application”, I am not talking about ones which run inside a browser. Instead, they are being installed on the local file system and run inside a runtime environment. Think of them like Java applications running inside the Java Virtual Machine.

Check out this youtube video where Flash’s multi-platform capabilities are being demonstrated.

Note: Since both, the iPhone as well as iPad, don’t support the Flash runtime environment, it is possible to compile Flash into native iPhone applications, which behave 100% as their originals (I, personally find this unbelievable!).
On all other platforms, there is a runtime environment, called AIR (Adobe Integrated Runtime), available. On Android phones, there is even a Flash Player installed which makes it possible to run Flash apps inside the browser. – Just one of the reasons why I am gonna buy the new HTC Legend in the next days. Sorry Apple :-P

For me, Flash is the new Java, which always claimed to be the platform-independent runtime environment for front-end applications. As good as Java is for backend-development on the web, the more it failed on the desktop and mobile phones.

Flash is not an animation-tool for designers anymore. It’s a serious SDK for writing great front-end applications in half of the time one would need using Java. ActionScript3 is a great programming language based on the object-oriented principles of java with some syntax similarities with JavaScript. In AS3, the developer has everything to code robust applications in OO-style: Classes, interfaces, polymorphism, events and more. Using Eclipse as the IDE of choice, one gets all the benefits of it like great debugging tools, for example.
Check this link out for a comparison between Java and AS3 syntax. You won’t see that much of a difference.

Flash is better than Java

Stop! Before you send me a letter-bomb, read this article first :-)

Update: After hearing about some misunderstandings regarding this post, I want to make sure, that the title “Flash is better than Java” is of course targeted at front-ent software engineering, not backend. Although it’s obvious that noone would ever try to build a web application backend using Flash, I just wanted to make sure that you understand what I am talking about :-)

If I talk to people and tell them that I love to use Flex, most say: “Eewwhh! Flex? Isn’t that… Flash? This animation thingy?”.

That’s what often makes me go nuts.

Don’t get me wrong. The Flash Player itself is shitty. It’s slow, unstable and has some serious issues regarding security. On the other side: The developer-side for Flex-coders is absolutely great and professional. ActionScript3 is an awesome object-oriented programming language and the nice features of MXML, like easy data binding, make it possible to create good-looking applications in no time.

If combined with the AIR runtime environment, which makes it possible to compile Flash applications into installable multi-platform desktop programs, I’d even go so far to say that it’s better than Java (on both, Desktop and Web).

Big IT-companies like IBM or SAP currently run experiments in order to verify if it is possible to replace Java (desktop-)frontends using Flex. This would shorten development time (since using Flex is so easy) and thus reduce costs. On top of that, their customers achieve great-looking and modern graphic user interfaces.
This replacement strategy does totally make sense, because Flex works great with common Java-based SOA architectures. Technically seen, it’s no problem to throw away an existing Java-frontend and replace it with a Flex version by simply connecting it to an existing J2EE backend. The reason: Using RPC techniques like class/object-sharing between Java and Flex over distributed networks is no problem since both languages are so similar regarding their object-oriented philosophy, as well as syntax. If you don’t believe me, read this.

Further, with the new Flex 4 platform, it is possible to improve the workflow between UI-designers and programmers using Flash Builder 4 and Adobe Catalyst. The idea is as follows: Before Flex 4, designers created user-interfaces and sent these to the developers, who then started transforming these drafts into actual programs. Now, if the designer wants any changes to the layout, he needs to ask the the developer to implement these changes. This is not very efficient. With Flex 4 and Catalyst the whole workflow has changed: Designers now create the user-interface using Illustrator. Then, they export their drafts into a *.fxb file using Catalyst, which needs to be sent to the developer, who just has to import this file into the project and can thus focus on the actual application logic instead of bothering with the UI. If the designer now wants any changes to the UI, he simply updates his *.fxb file and the developer re-imports it. Done. Can Java do this? No.

I don’t want to start a flame war, this is just my personal opinion from my experience with both worlds of Java and Flash.