Java Why Choose Java: Reasons to Learn Java Programming

  • Thread starter Thread starter Theia
  • Start date Start date
  • Tags Tags
    Java Programming
AI Thread Summary
Java is favored for its platform independence, allowing applications to run on various operating systems without modification. It excels in large-scale applications due to its robust object-oriented features and extensive libraries, particularly for user interfaces, which Fortran lacks. While Java's runtime performance is generally lower than that of Fortran, it is preferred over Python for large projects because of its stronger type checking and built-in object orientation. Python is better suited for quick, small-scale tasks, while Java is the language of choice for Android development. Ultimately, the decision to learn Java depends on the specific programming needs and project requirements.
Theia
Messages
121
Reaction score
1
I've been wondering a while what are the reasons I should learn Java programming language. Thus far I've mainly seen someone saying how cool Java is and how it is this and that. But. I haven't found it 'cool', or to be honest, useful at all (and I could state that Fortran is cool...). Being such, I'd like to ask your experience, what are the things Java handles best, and why you'd chose Java instead of some other programming language in such cases? Of course it does depend on what kind of program should be done, and I'd think it is my main issue. I haven't seen anything where I'd need Java. But maybe someone could mention some examples where Java beats the others? Thank you! ^^
 
Technology news on Phys.org
Theia said:
I've been wondering a while what are the reasons I should learn Java programming language. Thus far I've mainly seen someone saying how cool Java is and how it is this and that. But. I haven't found it 'cool', or to be honest, useful at all (and I could state that Fortran is cool...). Being such, I'd like to ask your experience, what are the things Java handles best, and why you'd chose Java instead of some other programming language in such cases? Of course it does depend on what kind of program should be done, and I'd think it is my main issue. I haven't seen anything where I'd need Java. But maybe someone could mention some examples where Java beats the others? Thank you! ^^

Hey Theia! ;)

Java offers the following differences with Fortran:
  1. It's platform independent - a java binary runs on any platform, be it Windows, Linux, Mac, Android, iOS, or whatever.
  2. It scales better due to its inherent object oriented support. That is, it's the better choice to write large programs that may become (much) larger.
  3. For the same reason it's lower on maintenance.
  4. It has extensive standardized libraries, including user interface libraries, which Fortran lacks.
  5. On the downside, its run-time performance is typically lower than Fortran, so it's not unusual that performance critical parts and/or parts that require dedicated platform support, are written in C++ or Fortran.
 
Thank you for your reply, I like Serena. But aren't all this included in e.g. python too?
 
Theia said:
Thank you for your reply, I like Serena. But aren't all this included in e.g. python too?

Ah, let me continue then with the differences between java and python: :)
  1. Object orientation in python is more of an add-on than built into the language - not good for large scale programs.
    For instance, it does not provide access level protection in its objects. It does not provide interface definitions. And so on.
  2. Python has no type checking, making it bad for large scale programs and maintenance.
  3. Python is an interpreted language, meaning it's many times slower than a java binary.
  4. User interface libraries for python are very basic. Nothing like what java has.
  5. The advantage of python is that we can create a small program quickly and easily that does a job.
    That makes it suitable as a "glue" language to connect different "real" programs to each other.

Oh, and did you know that java is Google's language of choice?
It's the native language for their Android devices.
 
Having been working on C#, Java and Python, I would say that the preference is dependent on your application. C# and Java are closely related and have a very similar syntax. For me I prefer C# because of the advantages it offers especially in GUI and Thread handling. For me, the only advantage Java has over C# is being platform-independent. For python, it is very useful for applications that have no GUI. Also it is very good for mathematical purposes and implementing and analyzing algorithms. In short, if you need something quick and not huge, Python is your best shot.
 
Thank you both of you! ^^ I think I understand Java's popularity a little better now. :D I haven't thought python being "a glue", thought - I've used sh scripts to put different programs together. But well, why not. As for Java and Android, no, I didn't know.

C# is another big hole in my knowledge. Several years ago I made some short programs in pure C, but as far as I understand, C# is something completely different.

Maybe I then keep coding Fortran for now. But I need to consider more carefully what language to use for some bigger programs I'm planning... Thank you again!
 
Last edited:
Theia said:
Thank you both of you! ^^ I think I understand Java's popularity a little better now. :D I haven't thought python being "a glue", thought - I've used sh scripts to put different programs together. But well, why not. As for Java and Android, no, I didn't know.

C# is another big hole in my knowledge. Several years ago I made some short programs in pure C, but as far as I understand, C# is something completely different.

Maybe I then keep coding Fortran for now. But I need to consider more carefully what language to use for some bigger programs I'm planning... Thank you again!

Let me give some more background then. ;)

Yes, sh scripting is used to put different programs together. Both perl and python evolved from sh scripting, based on the need for more elaborate programming constructions and performance while maintaining the power of sh scripting.
All of them are interpreted languages, meaning they are powerful but slow.

Once upon a time C and Fortran were created. The definitions of those languages, including their libraries, fit on a couple dozen sheets of paper.
Then C evolved into C++, in which object orientation, templates, and a much larger library was added. Those take up hundreds of sheets of paper.
Then, inspired by C++, java and C# were created, improving the syntax, object orientation, and again adding a much larger library, although they run significantly slower (but not as slow as scripting languages).
C# was created by Microsoft, meaning it will only work with Microsoft products, and it does it well.
Java was created by Sun and has been released to the general public.

C, Fortran, and C++ are compiled languages, meaning they are fast, but after compilation can only run on the target platform.
Java and C# are compilation-just-in-time languages, meaning the actual compilation only happens just before it is needed on the target platform. As such they can run on any platform and still have (some of) the power of compiled languages.
 
For the record, I'm an experienced programmer in C/C++, perl, java/javascript, bash, python, C#, and basic/vbscript (in that order, which is based on my personal preference). Nowadays I earn my living with the first 5.
I have no real experience with Fortran - as far as I know it is only used for scientific computing and comes with historical baggage. To be fair, C/C++ also comes with historical baggage, which is why java and C# were invented.
 
Yes, Fortran is mostly for numerical computations, and thus far I've liked that most. The only 'bad' feature in Fortran in that purpose is limited accuracy - you must know the precision before you start computation. Also arbitrary large integers are not supported. So if you must know the 300th digit of pi or try to factor large integer, then Fortran is not the best choice.

I've mainly used Fortran (numerical simulations and some other stuff), python (where Fortran can't do the job) and sh. But my programs have been mostly numerics without need of GUI or anything else that would err.. slow down the process. xD
 
Back
Top