14

I'm still a student, without much real life experience in programming. I've never written anything bigger than ~5k lines of code. I've written code in both Flash and Java, and I just can't understand why people are writing web applications like video players (YouTube etc.) in Flash, and not as Java applets. So I want to ask you, programmers with hands on experience, for some wise words on the subject.

I see no real benefit of Flash over applets, while on the other hand, at least to me, it seems buggy as hell. I understand it is faster to make something in Flash, and I can see why it would be a good thing for fast prototyping, but in general, is it worth it? Every time a YouTube goes berserk, i curse the developers for writing it in Flash. And if you are using Linux with Opera, this happens all the time.

So, basically, why are people using flash, and not applets?

Adam Lear
  • 32,069

6 Answers6

34

Flash provides a more seamless experience for the user. Java applets are pretty slow, since the Java VM needs to be fired up before they can run. As a website visitor, I hate it when things freeze for a few moments while the Java VM figures itself out. If I'm not mistaken, it also doesn't unload once I navigate away from the website that used it, leaving it hanging around when I didn't really want it to run in the first place.

My (admittedly limited) experience with Flash and applet development also tells me that developing an animation in Flash is easier.

And then there's history. Microsoft didn't do Java applets any favours by developing their own JVM and making it behave differently from Sun's. As a result, the same applet could work in one browser and not another, which made creating Java applets less viable.

Java does have free tools that can be used as opposed to proprietary Flash editors required to make Flash videos, but ultimately its heavy-handed approach makes it inferior.

Adam Lear
  • 32,069
4

Flash audio and video playback is as buggy as hell, but Java isn't always better. I've had some immensely frustrating problems with Java games when Sun has introduced a bug between minor versions which screwed up the applet lifecycle. They only really started getting their act together with applets about a year ago, and even then it wasn't perfectly smooth.

As far as games go, the biggest advantages of Flash were probably a more specialised development environment and good library support for vector graphics. The biggest advantage of Java was probably the ability to do true 3D with a signed applet and JOGL/LWJGL.

Peter Taylor
  • 4,043
2

simple answer is.. flash is for designers. and java is for programmers it doesn't get any easier than this.. not one better than the other.. they're just different tools for different jobs.. so to assume flash or java being superior to one another.. is just a bias.. they're just different tools both get the job done in different contexts.. as for the downvote.. i don't see your point.. it is relevant to say such things.. and not let bias get in the way..

you left a downvote ? how about telling us all why in a constructive manner? :)

2

The runtime overhead for Java Applets (in Windows at least) is far clunkier and slower than that of Flash (in my experience), and I believe that the Actionscript language is higher level that of Java, therefore this makes things like animations and resource handling (such as music/videos) easier to develop.

2

Java has never had very appealing UI. It took them years to even have anti-aliasing, making text hardly readable. Multithreaded rendering/interaction is afaik never implemented in the main java UI libraries. That adds to the already sluggish feel those UI libs have.

As java is designed for huge projects, it has a significant advantage using existing code in the browser.

Html capabilities have been significantly increased the past years. Cross-browser compatibilities have been edged out, and some features are added such as clientside storage and canvas.

GWT offers quite a nice API to create UI with highlevel classes and interfaces for panels and widgets. It translates it to javascript, making a fierce comeptitor for java applets and flash.

Ruudjah
  • 558
2

Flash developers are cheaper than java developers on the whole. And you can find graphic designers capable of working in or with flash. So you can get a prettier product out cheaper.

Wyatt Barnett
  • 20,787