Is Java cross platform still a language of choice?

343    Asked by NishiVerma in Java , Asked on Oct 12, 2022

 When I started using Java in the nineties, it was all "Write once, run anywhere!" from day one. That was probably all true then and I was a part of the choir as well.

I am not sure what to think about that anymore, considering all the other languages using multi-platform runtimes (python, flash, perl, html, php...). But I am still seeing lots of arguments that say you should use Java because it is supposedly better for cross platform development.

So, Is that still true today? Is Java still the language of choice for multi platform development?

Please be specific with focus on cross platform aspects.

I am not asking for general language feature comparisons.


Answered by Nitin Singh

Scripting style languages such as python also make Java cross platform development easier. Now, whether you like Python (or other such languages) depends on you, and we probably don't need to start that debate here.


Java tries to force you to write code which will run portably, while python allows you to write portable code. The actual python language itself will run portably, but external libraries may or may not. Additionally, python will freely give access to platform specific services.

Does Java have an advantage there? I think in either case you can write the portable code with similar ease. That is, you can write code and it will usually work on different platforms. But you cannot get away with just writing code and assuming it will work everywhere. I've worked on a python project which produced versions for Windows, Linux, and Mac and we ran into very few cross platform issues. (The only one I remember was due to a bug in the library we were using pygame, which caused drawing issues on Linux. This was fixed by upgrading the version of pygame we used)

Another issue is deployment. If you want to distribute standalone programs that run your code you will have to produce different versions for different platforms. For Java you can distribute one version and assume that the user has Java installed or can install it. In this case Java probably wins in the simplicity of the deployment department.

In the end, I think it comes down to what language you like working with and what kind of deployment you need to perform.



Your Answer

Interviews

Parent Categories