Question:
why is java not suitable for desktop apps?
Dhanasekaran K
2014-02-21 21:02:35 UTC
I see most desktop apps in windows and Linux like the web browser or the media player or office suite are not in Java. Linux kernel for example is not java. Is it still C/C++ for desktop apps ? Why is java not suitable here. Is java best only for web application development ?
Six answers:
Neerp
2014-02-22 07:51:15 UTC
Minecraft is in Java. BUT if they had written it in c++ it would be TEN times faster and use a fraction of the resources that it does.



Java apps tend to be bloated and slow. It is the nature of java. It is interpreted, and the run time environment is bloated and slow.



Java apps tend to have a lot of problems with different runtime version installed on the client computer. I can't tell you how much problem that causes. You try to run the app and it won't because you don't have the correct java runtime.



Because of this, I refuse to use java. No, it is not suitable for web based applications because of the problems with runtime version, and poor performance.
?
2014-02-22 19:34:12 UTC
Java apps are run in an emulator called the Java Virtual Machine. As a result, a java app can run on ANY platform that has the JVM. It's platform independent. This allows program developers to just rattle off an app and have it immediately available for PC, Mac, Android, and iOS without porting and recompiling. Smartphones and tablets (with the exception of Windows 8) run almost everything except for the OS itself in the JVM. However, running an emulator has some overhead to it, so Java applications are usually not as fast as a similar native application. Apps where performance matters are usually written in C or C++ because they produce a native binary executable (.exe file in Windows). Office programs, web browsers, and media players are big, resource-heavy programs, so efficiency really matters. You can only run a Java program on something that has a JVM. So it's hugely impractical to write an OS kernel in Java. Basically, Java is the best language ever for making your program cross-platform, but it falls short in efficiency.
Ratchetr
2014-02-22 06:10:23 UTC
Java's best claim to fame is that it is a write once, run everywhere programming language.

And it is *very* good at that.



But that comes with a cost: It means having to cater to the lowest common denominator. Getting a run time engine like Java to do exactly the same thing on every platform that Java runs on, *AND* at the same time, making it work and feel like a native application, not some half-arsed Java app is an extremely difficult task to pull off.



Java has gotten much better at this over the last 10 years. It used to be that if you ran a Java app that displayed a File Open dialog box, that dialog box was so *radically* different (and far worser) than every other File Open dialog box that native applications used, that you would just say...YUCK...JAVA APPS SUCK. (They did). Writing an OS agnostic GUI is hard...really, really friggin hard.



One area where Java fares well is middleware. Code that has no UI. Code that might do things like shuffle data between point A and point B (A might be a TCP/IP socket or a web service. B might be a file or a database). Java shines here, because OS differences can be abstracted fairly easily. Sockets are sockets. Databases are databases. People don't ***** if things are a different shade of gray or the tab key doesn't work the same.



Writing an OS in Java would be tough. Java does OK at abstracting the differences between different OS'es, but that doesn't mean it can do well at *BEING* the OS. It wasn't designed to do that.
Andy T
2014-02-22 05:08:26 UTC
That's mostly a left-over from pre-Java era, now given PCs are powerful now... Minecraft is in Java!



Kernel is a very technical reasoning. No Python, nor Java, not C@, Ruby is forbidden; only C/C++ or even Assembly (too much) and nothing else.
ratter_of_the_shire
2014-02-24 01:41:07 UTC
Well first off developers want their applications not be be resource hogs and perhaps more importantly be portable to odd system like MIPS or POWER or Itanium where there isn't a look of good support for the JVM.



Second it's a lot easier to link to the libraries they rely on in C/C++, and by doing so it matches the rest of the system.
Carling
2014-02-22 05:06:51 UTC
Reason java is a insecure system


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...