Why Choose Java: Reasons to Learn Java Programming

In summary: 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...In summary, Theia is curious about the benefits of learning Java and asks for other programmers' experiences with the language. Serena explains that Java offers platform independence, scalability, and standardized libraries, but may have lower runtime performance compared to Fortran. Theia also asks about the differences between Java and Python, to which Serena responds that Python is not as suitable for large scale programs due to its lack of built-in object orientation and type checking. Theia then thanks both Serena and another programmer for their insights and expresses
  • #1
Theia
122
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
  • #2
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.
 
  • #3
Thank you for your reply, I like Serena. But aren't all this included in e.g. python too?
 
  • #4
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.
 
  • #5
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.
 
  • #6
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:
  • #7
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.
 
  • #8
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.
 
  • #9
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
 

FAQ: Why Choose Java: Reasons to Learn Java Programming

Why is Java considered a popular programming language?

Java is a popular programming language because it is versatile, easy to learn, and has a wide range of applications. It is used in web development, mobile development, game development, and more. It also has a large and active community, making it easy to find support and resources.

What are the benefits of learning Java?

Learning Java can open up various career opportunities as it is widely used in the tech industry. It is also an object-oriented language, which makes it easier to organize and modify code. Java is also platform-independent, meaning it can run on any operating system, making it a highly versatile language.

Is Java difficult to learn?

While learning any programming language takes time and effort, Java is considered to be relatively easy to learn compared to other languages. Its syntax is similar to English, making it more readable and easier to understand. Additionally, there are many online resources, tutorials, and communities available to support new learners.

What are some real-world applications of Java?

Java has a wide range of applications in the real world. It is used in web development to create dynamic and interactive websites. It is also used in mobile app development for Android devices. Java is also commonly used in game development, scientific and financial applications, and large-scale enterprise systems.

Is Java still relevant in today's technology landscape?

Yes, Java is still highly relevant in today's technology landscape. It consistently ranks as one of the top programming languages in demand by employers. Many popular and widely used applications, such as Minecraft and Android apps, are built with Java. It also continues to evolve with updates and new versions, ensuring its relevance in the future.

Similar threads

Replies
6
Views
4K
Replies
5
Views
1K
Replies
18
Views
8K
Replies
10
Views
6K
Replies
7
Views
945
Replies
33
Views
8K
Replies
4
Views
2K
Back
Top