We’re Moving to Flash. Here’s Why
This post is the first in a series regarding a complete port of a very large Java project to ActionScript. Stay tuned for the intricacies that arise in doing so.
| Goodbye, indeed. Image via Wikipedia |
I’ve been developing in Java for about four years now. For four years, I’ve defended the Java language. I’m moving on.
Up front, I’ll say that the reason we are moving to Flash is because of Java’s adoption rates. It is not, in fact, because of the language itself but because of Java’s deployment model. We suspect that we lose somewhere between thirty and fifty percent of users due simply to the fact that we are in Java.
This isn’t pure speculation, but backed up by a significant amount of internal data. There are also other game companies that have experienced the same thing.
The Technology
I’d actually prefer that we remained in Java. My background is in high-end visualization so I love that we could use OpenGL. This also means that in the future we could do lots of really fancy special effects. The problem is that OpenGL ties you to the hardware, and anytime you do that you are opening yourself up to a world of support problems. We’ve already seen our fair share.
The hardware isn’t really the problem though. We could have avoided using OpenGL and just used SWT, AWT, or Swing. There are other open source projects that we were using that we’ll have to dump as well.
It’s unfortunate, really. The Java language is way better than ActionScript and Java compilers are much more advanced. There are also more possibilities with Java. Moreover, even though Flex Builder is built on Eclipse, the Eclipse development environment for Java is years ahead. I say that with no bias, having just finished porting about 800 classes and nearly 60,000 lines of Java code to ActionScript.
The Java Brand Is In Trouble
Java’s brand is failing. JavaFX has long been touted as the solution to Java’s woes, but it has been too long in getting released. In the meantime, Flash has continued to dominate. Silverlight has come on as a competitor, but it will be years before it has the kind of market penetration that Flash has.
The single biggest problem with Java right now is the name itself. If you see the Java applet loading, you click every visible link that you can to get off the page.
Why Java In the First Place
We got to where we are now faster because we were in Java. We even knew that we would probably port to something else eventually. Because of that, we built a flexible architecture that wasn’t tied to the language but abstracted in many ways. From the way we used data structures to the way we persist our asset data, we made sure we weren’t reliant on Java. In doing so, we were able to take advantage of the tools that we were familiar with in order to get to the point where we had a complete understanding of the architecture we were building.
That’s where we were two weeks ago. In that time, we ported our player architecture to ActionScript, and I still have 41 days on my trial version of Flex Builder.
In the upcoming week or so I’ll be following up this post with a lot of the lessons that we learned along the way. It’s been a very rewarding and, at times, frustrating process. I hope you stay tuned.
Tags:ActionScript, Flash, Java, porting![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=a362b71e-a78f-4a7b-b42c-ee281355e104)
5. November 2008 at 3:10 pm :
Flex is definitely the way to go. I’m developing a Flex app right now that I’m planning on distributing as an AIR application. It’s database and local encryption features are awesome.
WTG, and good luck on the port!
5. November 2008 at 3:41 pm :
My reaction is a bit hesitant. I know that Seesmic is moving away from Flash…are you putting on golden hand-cuffs while moving to Flash? I’m really not sure…
Interested to read more.
5. November 2008 at 3:45 pm :
So you noticed that Java is not to be used on a website… more than five years after everyone else.
5. November 2008 at 4:22 pm :
Also definitely looking forward to the lessons learned post…I think its common for startups to go through large tech changes like this…all in the name of GROWTH.
Best of luck!
5. November 2008 at 4:58 pm :
The reasoning behind this is the most bizarre I have ever read. “There’s nothing wrong with it, I’d rather stay, it got us where we are quickly but I don’t like the brand name”. Weird.
And you say we click around to get off a Java page? That’s the first I’ve heard that. If anything, I groan when I see a Flash loading page.
Now, before you say anything. I only looked at Java once and don’t do Flash yet.
5. November 2008 at 5:04 pm :
@Ryan:
Where did you hear that Seesmic was moving away from Flash? Just curious.
-James (Adobe)
5. November 2008 at 5:21 pm :
Bravo! This was an excellent decision.
5. November 2008 at 10:01 pm :
To be honest I hated both Java and Flash for not being portable some time ago. But now, that Java is more open and Linux has started to get *official* support from Sun, I see things differently. Now, only Flash sucks.
5. November 2008 at 10:36 pm :
@Mark good luck as well! Despite some issues I’ve been pretty happy with the way things have gone.
@Ryan I’m curious as well where you heard that, and what are they moving to? I saw that they were supporting more than just .flv files now.
@Fabien As I mentioned, we made a conscious decision to begin in Java. I have no regrets about that.
@Rob It’s not that I don’t like the brand name. Simply put, any company is better off if their technology works with 99% of their customers machines rather than about 60%.
@Adam apparently not everyone thinks so
@Cristian Even with support from Sun, Java’s deployment model has problems and JavaFX has a lot of catching up to do. It will be years before Java’s market penetration could be on par with Flash’s.
5. November 2008 at 11:13 pm :
@Cristian, what do you mean by portable? Flash 10 was released on Windows, Mac and Linux simultaneously. Admittedly, the Linux version still has a few bugs but Adobe are almost there.
Flash is pretty open these days too. You can have a look at the SWF spec if you like. The Flash AVM is open source and has been donated to Mozilla. Heck, you’re even free to build your own Flash player if you don’t like the one Adobe provides. Flex is open source too of course, the Flex SDK is free, etc.
Sure, Flash is one of the most abused technologies on the web but that’s because it’s a victim of its own success. I don’t think that’s a flaw of Flash though. Look at online video. I’d argue that Flash made YouTube possible.
@Dale, good choice. I’ve been using Flex for a couple of years now and I think it’s the best option avaibalable now for RIAs and complex UIs. As you say, the dev tools are behind the Java equivalents but Flex Builder is getting better (and compiling faster) with every release.
5. November 2008 at 11:22 pm :
You gotto be kiddin right? are you an Adobe employee? Noone uses Flex for anything serious out there except but the blog writers for some reason. They all talk about how Java is bad, and Flash is really awesome. Javascript JIT capable browsers are hitting the market, are you aware of that? So it is not Java that Flash should be targeting but completely Browser based applications. On the other hand, Java will always be there living either at the server or the client.
6. November 2008 at 2:53 am :
I think you are absolutely right to move to Flex. A site like http://parleys.com would not be possible with Java. I always laugh at the sentence “Java was the first RIA solution before RIA was invented” by Sun. Have they actually tried to run a JavaFX script lately? I did not, because I am not under Windows for JDK6u10 under a specific browser version. So much for the platform independence.
Flex / AIR or Ajax with Gears/Prism is the way to go in the future.
6. November 2008 at 5:16 am :
I, too, am amazed that the subject title does not emphasise “Front-End” where the choices are really quite varied.
For front-end GUIs the jury is still out what to use and, most particularly, what is SEO friendly … as much as I like Flash and Flex, I prefer to stick to uncomplicated html/css for presentation as this includes the widest browser base.
For a captive user base (in-house), sure why not Flash/Flex.
Using Sun Java as a back-end tool I have absolutely no qualms about sticking with, probably, the best development language for quite a while (cue: sound the Air Raid sirens!) and include any of the script languages when needed (Groovy/Grails).
It’s amazing how alike-looking some of the recent languages are to Java i.e. C# and Flex.
For those who like to sound the death knell for older/established languages, take a look at the real world and economics, the more people available the cheaper the price, and the rise in worth of knowledge of the older language.
6. November 2008 at 7:28 am :
Personally I look forward to seeing what the Java logo will bring. I associate Flash with some annoying marketing exercise and Java with something innovative.
6. November 2008 at 9:03 am :
I don’t know, Flash doesn’t support 64 bit systems yet. I personally am finding it /extremely/ frustrating not to be able to watch video links. If they fix that soon, well and good but I understand that it’s not all in their hands and I can only see the number of 64 bit systems increasing.
6. November 2008 at 9:44 am :
I love this dialog. This is a huge decision and I’m eager to hear what everyone has to say. Keep it coming.
@Boran It’s hard to do a cross-browser graphical application in JavaScript right now. There are a few frameworks out there but we’d have to build a lot ourselves. Furthermore, while you can decompile Java and ActionScript, they’re easier to obfuscate. JavaScript isn’t well suited to a project with 60k lines of code either.
@Mark Dathorne and @Sakaruba These are excellent points. We still have a Java server and have no plans on changing that. As for SEO, we have a combination of HTML/CSS and the in-browser application that should take care of most of this. The games themselves don’t have much for indexable content in them.
Thank you as well to those of you in support of this project.
If I can reiterate one last thing: We would never have moved to Java (on the client) if we didn’t have firm statistics regarding the percentage of users that actually make it into our application.
6. November 2008 at 9:54 am :
Even though I use a few Java-based apps, I am not a fan of Java. Never have been, and probably never will be. Sharendipity never worked right for me, and I blamed Java. I’m not the biggest fan of Flash either, but I look forward to the change.
6. November 2008 at 9:54 am :
I watched evolving of different languages (and the IDE’s, tools and libraries around them) for about two years taking the definite decision to go with Java a few months ago. However, I will not port any of the old projects, only do new projects in Java.
Flex and ActionScript for me was never a real choice because IMHO a more specialized thing and I was searching for a more allround-language. If you are developing first of all games on the net then your decision might be the right one. I didn’t have that special focus when evaluating.
I think your decision cannot be generalized. From the view of the “default user” I can imagine that you are right that they might click away earlier when they see the java starting. However I also remember flash things loading a longer time. The users might not get aware of that because different animated stuff is presented to them. If there would be always the same Flex-loading-logo while loading then they would also click away maybe.
6. November 2008 at 10:34 am :
@Pete Prodoehl Just in the past few weeks since we made this decision we’ve heard this repeatedly. Java just wasn’t working for our users. It’s all about their experience, and it’s really hard to do that right in Java.
@Martin Wildam The IDE is a big problem with Flash, but I’ll put it up with it if it means that I can get the application to work for people like Pete. I liked a lot of other things about Java, but we need to cater to the user. Having more of them makes me very happy.
6. November 2008 at 12:52 pm :
Even though Flex Builder is not as advanced and clunky at times, it surely beats the hell out of coding HTML + CSS + JS for rich UI though.
6. November 2008 at 2:01 pm :
I also just finished migrating a large Swing app to Flex, and my experience has been very positive.
The only thing I really miss is a good IDE, such as IntelliJ. FlexBuilder 3 has a long way to go before it gives you similar productivity features.
Our app now uses BlazeDS to interact with Java-based server components (that, in turn, use Hibernate/JPA). This has proven to be a good combination.
6. November 2008 at 4:17 pm :
It’s disappointing to hear that Sharendipity (one of the featured JOGL apps) is moving to Flash. We just completed a major rewrite of the Java Plug-In in Java SE 6 Update 10, which makes Java applet deployments more reliable, powerful and portable. 6u10 is available for Linux, Solaris and Windows now, and we at Sun are actively collaborating with Apple to bring it to the Mac. It is the first in a series of steps being taken to revitalize client development on the Java platform.
By the way, you can easily replace the Java logo animation with your own image using the “image” applet parameter:
https://jdk6.dev.java.net/plugin2/#LOADING_SCREEN
and the new and improved “boxborder”, “centerimage”, “boxbgcolor”, and “boxfgcolor” parameters:
https://jdk6.dev.java.net/plugin2/jnlp/#EXAMPLES_JAKE2
6. November 2008 at 4:51 pm :
@Ken First of all, I truly appreciate your help in addressing our JOGL issues in the past. I really do love OpenGL and I’m glad that JOGL has seen significant advances since the early days of GL4Java. It’s important as well that Sun is addressing the deployment problems.
There are two problems that an application like ours has with OpenGL. First, there aren’t enough users in the casual games space with systems that are capable of running our app while maintaining usable performance. Without the resources to perform QA on these issues, we just can’t stay with OpenGL. As I mentioned, we could do software rendering, but you probably don’t want to hear that either.
The second problem, as I see it, is that update 10 is going to take too long to gain the penetration that we require in a platform. As it is, we are currently deploying to 1.4.2 because of the market penetration of previous versions of java.
I hope that Java can solve these problems and rebuild the excitement that development communities once had about it. The biggest hill that has yet to be climbed is to get to the point where it all “just works.”
6. November 2008 at 6:04 pm :
Just out of curiosity, when you say internal data to backup the claim that users are lost because of Java, does that include any sort of communication with your target audience?
I admit I am from the camp that cringes at the sight of the java icon popping up on the system tray, but I have a tendency to believe that not-so-tech-savvy users don’t necessarily feel the same way (especially late generation Y/generation Z). I was just curious about whether there are reported roadblocks for these users (e.g. installing java, version problems, actual aversion to the Java brand, etc)
6. November 2008 at 6:15 pm :
@LeoHorie we have in fact talked to a lot of users that have had issues with Java. In some cases we’ve been able to work with them to figure it out but it’s really hard to get a frustrated user engaged in a QA process when we can’t reproduce the problem. I think that the biggest wake up call came when we publicized the decision and heard the overwhelming responses, such as “I hope the transition goes well. Sharendipity rarely worked correctly for me.”
6. November 2008 at 6:59 pm :
I’m sorry but I don’t like Flash at all. I don’t like Javascript as it is very much, but I think that Flash is much much worse. Also Flash is evolving as some other Adobe things like Reader: more and more bloated and resource-intensive over time.
Also Flash made way for evil Silverlight. Were will we go if all internet future is made of proprietary technologies ? Were will we go if we need to download scores of these huge incompatible mammoths ? At least we can still hope that JavaFX will share the same open future than Java is having now.
I really look forward to HTML 5 capable browsers killing Flash with a mix of jitted javascript and canvas 2D drawing.
6. November 2008 at 7:01 pm :
Just to be clear. Silverlight is not evil because it is Microsoft. I just fear that internet will collapse under the weight of more and more proprietary specificities.
6. November 2008 at 10:22 pm :
Here’s my 2 cents..
When you’re writing an app for public consumption and the success of your app relies on people liking your app and using it then you need to use the technology that has the least number of hurdles in achieving that. Any complication, confusion or annoyance will drive the user away. In the current state of the internet that means flash or javascript. If java had spent more time working on the experience users have when installing java and loading java applets then the landscape might be different. Flash doesn’t sit in my system tray and annoy me. Flash doesn’t constantly pop up and ask me to update. Flash doesn’t make me restart my browser when I’m done installing. Even Silverlight has a better installation and app loading experience than java and they’ve only just arrived on the scene.
I applaud Sharendipity on their decision to move to Flash. I think it was a wise decision and will greatly improve their product.
6. November 2008 at 11:18 pm :
@Herve I don’t want to think of it as the lesser of evils, so I’ll state it this way: a startup’s survival depends on their ability to quickly change direction and adapt to the current state of the art. You want to be able to plan for that future, but with you can’t wait for it either. Right now we see only one solution and that’s Flash, proprietary or not.
7. November 2008 at 3:01 pm :
>> it’s really hard to get a frustrated user engaged in a QA process when we can’t reproduce the problem.
Indeed. That’s the type of situation I’d want to avoid at all costs.
I hope Flash works out for you without too many headaches.
@Herve: I really doubt the Internet is going to collapse because of the choice of technologies developers make
7. November 2008 at 3:51 pm :
Good luck on that idea of going to flash. I suspect you’ll be making your move about 5 minutes before your miracle…Sun’s the first to admit that JavaFX has been a long time coming, but like most things in life, good things come to those who wait.
Have you downloaded the preview of JavaFX and played with it?
javafx.com
LKR
7. November 2008 at 4:30 pm :
@LKR Actually things have gone very well. We built a working prototype in about two weeks. Miraculous, maybe. But possible nonetheless. Unfortunately, we just don’t have time to wait. If you still think this is such a bad idea, maybe you should see what the java gaming community has been saying: http://www.javagaming.org/index.php/topic,19373.0.html.
7. November 2008 at 4:46 pm :
You can also publish your Flash games using Adobe AIR to get a self-contained app that can be played offline. And no 50 MB Java VMs or JDKs for your users to download.
8. November 2008 at 8:25 am :
Chris – why the hell would an end user need to download the JDK??
The Java VM is a 17 MB download (on linux anyway). That’s nothing in the modern age of broadband.
Hell, I’ve seen hardware drivers larger than that…
I’ve never been a fan of web-based games, or Rich Internet Applications. Websites should be for providing quick access to INFORMATION, and links to applications that I can download and run outside the confines of the limited web browser.
8. November 2008 at 10:49 am :
parleys.com was ported to JavaFX with additional features made possible by Javafx. The creator of the site is presenting this experience in various Java conferences.
14. November 2008 at 7:57 am :
Yes, at Java One the gentleman who developed the Parley’s site was gushing about how he had rewritten it in JavaFx and how much better of a development experience it was than Flex. He demo’ed it and it will have better feature / function based on having access to the Java API’s underneath.
I think the revitalization of Java on the client is just beginning and once the JavaFx release occurs, and people try in earnest to develop with it, which feeds ongoing development cycles, it will begin to run circles around Flex and others for providing really rich (games, etc.) consumer experiences in the browser. This will take time though and the rebranding of java on the client as a serious contender will take a couple of years. I think it will gain traction as people begin to do things with it that just aren’t possible with the Flash runtime.
14. November 2008 at 7:59 am :
> JavaFX has been a long time coming, but like most things in life,
> good things come to those who wait.
I also prefer to wait a little longer but then get better quality. (Just tired of being the free of charge Beta-Tester for M$ – struggled around days and days with the first .NET releases)…
Investing enough time rules!
> I’ve never been a fan of web-based games, or Rich Internet
> Applications.
Agree mainly. There is some dynamic website change that improves performance of a web application and web applications have their advantages (and disadvantages). In my opinion it is a just a hype that most applications want to be web applications – even vmware infrastructure client moved to web app – being slower over the browser (logically).
Do you want to know a reason why many choose to create a web app instead of a thick client: Because under Windows people have bad experiences with setups destroying something on the OS or the fact that deployment is needed in general – and actually (I know that from own experience very well) after installing an application on 2 of 5 workstations a problem arises due to some wired settings or conflicts with other applications. So this is also a matter of reliability of the underlying OS.
14. November 2008 at 9:15 am :
@DavidS @Martin DavidS’s comment “This will take time though and the rebranding of java on the client as a serious contender will take a couple of years.” sums up the reason we need to switch. Maybe in a couple of years, we’ll switch back, but as a startup with limited time and resources, we just can’t wait.
@Martin Personally, I think that more people are becoming accustomed to web-based apps because, typically, there is no reliance on permanent, local data storage. It’s nice having it all in the cloud. As you mention, there are also a lot of problems with installing apps locally. With RIAs, there is an expectation that things “just work.”
20. November 2008 at 8:56 am :
There are very few cases where the average internet application requires anything more than an html/css based user interface, which is why Java and Flash front ends are uncommon by comparison.
RIA’s are another story. An RIA should not require a browser to operate, it should allow for disconnected sessions where an internet connection is not available and allow synchronization with server data when local data becomes inconsistent with local data. In today’s world where connectivity is becoming abundant the need for RIA’s is rare.
The best example of an RIA I can think of is iTunes. It provides a useful way to manage user data (music), manage a user’s online account, manage transactions and synchronize with a mobile device attached to the users computer.
Java with a little help from JNI is perfect for creating this type of application. There are few cases however where developing an RIA is justified and in most cases a Web 2.0 (AJAX) solution is more than enough.
20. November 2008 at 3:13 pm :
Well.. it’s true only on the PC.. But Java for mobile (J2ME) is the future language for the mobile platform.. also now we have more cellphones that PC and more Java on mobile support than flash has on PC!!!
19. December 2008 at 3:30 am :
This is really, really interesting!
I will definitely follow your blog for updates on the process you’re using to port your Java application to ActionScript.
If you need to outsource ActionScript or Flex development, don’t hesitate to contact me.
Happy holidays!
http://obecto.com/
29. January 2009 at 3:06 pm :
[...] we started talking about a month ago, we made the decision to port the Sharendipity platform to Flash. We’re really excited to [...]
6. February 2009 at 5:44 pm :
Just wanted to correct some things previous posters said…they were comparing the size of JavaVM to that of Flash, and someone else said that Flash was big and bloated.
Just wanted to clarify the facts:
@JimF: JavaVM, as reported by a user above, varies in size from 7.1MB to 15.5MB on Windows. Solaris ranges from 9 – 32MB. Linux ranges from 17.1 – 19.1MB.
See here: http://www.java.com/en/download/manual.jsp
Flash 10, the latest release, is 1.8MB for Windows. After 10 generations, it’s still a very small download.
And Flash Player, as a poster notes above, has published its spec, open sourced its JIT, etc..
The Flex SDK is open source, and the development process for Flex is conducted in public — code is checked in to the public site nightly, specs are posted before the implementation, and the team actively listens to the community. In fact, just last week the team had a public session discussing the next steps for the APIs and Flex in general. Check it out at:
http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK
@DavidS — I can’t speak for Parleys, but I met them in December at Devoxx, and they had a new version using the features of Flash 10 that was simply mindblowing. The authoring environment used video frame processing in Flash 10 and did things that even we didn’t know you could do. They can now process a multi-hour video in minutes. I’ll leave it to them to speak further on that, but you should follow up with him if you’d like more info…I wasn’t sure how much of what he showed at FlexCamp he wanted other folks blogging about.
Hope that helps add a bit of info, and good luck with the next version of Sharendipity!
Cheers,
Dave Story
VP Developer Tools
Adobe Systems
2. March 2009 at 3:43 am :
Updated market penetration statistics validate your decision. Here is a look at both Flash and Java usage:
http://www.statowl.com/flash.php
http://www.statowl.com/java.php
16. June 2009 at 1:22 pm :
[...] are really excited to announce the launch of our new Flash Creator! As we’ve talked about many times before, we’ve been striving to improve your user experience within the browser. With [...]
14. August 2009 at 11:30 am :
[...] the beginning we thought that BugZilla would help track a lot of the discussions. At the time, we were coding in Java and there was a nice Eclipse plugin called Mylyn that integrated with BugZilla. But when it came [...]
19. August 2009 at 12:57 am :
Yeah, it’s a shame that sun doesn’t see some problems. The new Applet-loading screen that can’t be overriden that easy is just … stupid!
3. September 2009 at 11:38 am :
[...] mais visíveis, inevitavelmente elas irão cruza com tecnologias mais estáveis, como Java. Um post de blog recente da empresa de desenvolvimento de jogos Sharendipitous Moments, intitulado “We’re Moving [...]