In my final year project I have to build an Algorithm animator. It would be done to show how the algo works using nodes(PCs) and edges(connections). For example, how the leader ellection ring algo works.

Anyway, I haven't started implementing yet. My supervisor wants me to do it as a Java app, but I want to do it as a website. My reasons are :

1.nowadays, nobody downloads apps then install them on their machines. The just go to website that does all their work for them.
2.I HATE JAVA'S SWING. More generally code GUIs using Java.
3.The GUI could be much more elegant and beautiful written in JS.

However, still not convinced, my supervisor said that he is not a 100% against it, but he'd like to see more convincing reasons.

So, my Question is: What do you guys think should I go with Java or JS? and why?

Recommended Answers

All 4 Replies

Member Avatar for stbuchok

What are the reasons for the "Reasons Not To" side of things?

Here is my two cents...

1)I am not sure that #1 is actually against Java. Nowadays, many of people have Java plug-in for their browser (and most of the time is automatically installed when you install JRE). You could use Java Applet to do the same work.

2)The GUI on Java Applet can be more elegant if you do it properly. The problem is that it is more difficult to do because it requires a lot more digging and studying on how to use the language and classes. Besides, it is actually more difficult to do in JavaScript when it comes to draw images (not render image file but real draw). You could use SVG or libraries that help you, but it is still more difficult.

3)JavaScript is much slower than Java when it comes to computation. Also, a browser may pop up a window and ask you to stop the script if it takes too long to compute.

4)The real reason you do not want to do in Java is your #2 reason. :)

Anyway, if I were you, I would do it using whatever technology I feel more comfortable with and can finish it. If you do not like to code Java using GUI, Don't do it! It will give you a head ache because there will be too many things to figure out. If you believe you can complete it in JavaScript, then go ahead. ;)

Member Avatar for stbuchok

For better performance with JavaScript you can use Worker processes (newer browsers support it). It won't block the page from running while the script executes.

I still stand by my last comment (which may have been a little unclear), which to make it more clear "What are the reasons to not use JavaScript"? Performance shouldn't be too bad on modern browsers.

Performance isn't just browser-based, but also computer based. besides, if this were a real-life application, you can't be sure if everyone has a new browser version, or a fast enough computer.
It might not seem applicable to you, but you're teacher might disagree.
You're being trained for real life situations after all.

If you want to get a Java GUI, try finding a prefab, see if that works out.

I must say i can personally make a much better looking application with JS then with Java, since i can use HTML and CSS with it, and maybe even personalize a page using PHP.

Take into account that you are more likely to write proper, clean code in a language you like, then one you don't.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.