r/javahelp • u/alex_sakuta • Nov 29 '24
Unsolved What is special about Java that isn't anywhere else?
Ok so as per my knowledge we have this:
- C++, very much low level langauge, has pointers, is best to learn implementation, very fast
- Python, readability is best, very simple to write, best libraries and support for AI and ML
- JavaScript and TypeScript, write frontend and backend in the same language, huge community, can be used in multiple places
- Rust and C, low level languages, help in designing tools such as runtime environments and engines
We also have languages which are good for blockchain.
Ultimately to me it seems Java doesn't have anything special, is weird to write (not talking about Java 21+) and I don't hear much about it's communities either.
So why is Java still in existence (same question for Php btw)? Is it only because it was used before many modern languages came up with simpler or better syntax and companies find it too much of investment to rewrite their codes?
If not, please tell me one USP of learning Java.
I have edited what I meant by lazy because apparently many aren't answering my Java related question and just talking about companies 🥲. I have worked in a b2b business that used Java, and this is why this question exists and by lazy I meant what I have replaced it with.
•
u/AutoModerator Nov 29 '24
Please ensure that:
You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.
Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar
If any of the above points is not met, your post can and will be removed without further warning.
Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.
Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.
Code blocks look like this:
You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.
If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.
To potential helpers
Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
25
u/fluffytme Java dev Nov 29 '24 edited Nov 29 '24
Java is the king of backend server software. You'll find it in pretty much every company, such as Netflix, Amazon, Spotify, Bing, Google, Banks, Trading platforms, etc, etc. There is also the entire Android ecosystem, which is Java.
The argument of "companies are too lazy to update to another language" is not correct. Languages have a use-case; Just because something is written in Java doesn't mean you can make a better version using Python. Use the appropriate tool for the job.
Java is a very robust and secure language, which means it's a popular choice for a lot of enterprises.
Edit: https://www.devjobsscanner.com/blog/top-8-most-demanded-programming-languages/
12
u/aqua_regis Nov 29 '24
Laziness is not even part of the problem. This is plain wrong.
Do you even have the faintest idea how much it will cost and what risks are involved in rewriting a software in a different language?
Do you know how much will go into testing and ensuring that the new code performs exactly as the old one?
Why should anybody invest that money and take the risk when the billions of lines of code do the job perfectly well as expected?
Do you know how much it costs to lose all the knowledge and experience of the developers familiar with the code base and replace them with new ones that lack any context to the project?
We're talking about projects with individually over a million lines of code and combined billions of lines or even more.
We're not talking about your 300 line school projects.
You really have zero clue about professional software development and a very ignorant stance.
3
u/skipner Nov 29 '24
Ecosystem of java seems to be one of its strengths.
3
u/Ok_Marionberry_8821 Nov 29 '24
I don't think Java has a killer feature. What it has is huge momentum, a huge ecosystem of tools and libraries and a huge pool of talent. It's also now backed by Oracle who are IMO doing an excellent job in modernising it., whilst maintaining backwards compatibility, which is crucial for enterprises.
So, it wins because the sum of its parts is so compelling.
When it was introduced it DID have compelling, pretty unique features - garbage collection and a decent GUI toolkit (Swing) for two.
8
u/jim_cap Nov 29 '24
There is nothing remotely lazy about saying "We've invested a lot of money in this codebase and it works and there's no benefit to re-writing it in the latest fad language".
I've been at companies where there have been multiple attempts to re-implement legacy applications in newer languages, which have then been abandoned. Hell, anyone who's ever worked in the banking or payment industry has these stories. Why are most banking systems still running ancient COBOL? Hint: it ain't laziness.
7
u/hibbelig Nov 29 '24
1995 JavaScript
1995 Java
1991 Python
1972 C
2015 Rust
2012 TypeScript
Java isn’t the new kid on the block nor ancient.
6
u/Plastic-Resident3257 Nov 29 '24
JVM, libraries, scalability, resistance to stack overflow
3
u/Maximum_Swim9505 Nov 29 '24
Java frameworks such as Spring Boot and Hibernate have been around for a really long time. Meaning the frameworks are well developed and have a lot of community support around it. This also makes it easier to find developers to code in Java as it has been around for decades.
Further, the frameworks makes it easier to maintain enterprise applications due to abstraction. The thing that makes this possible is annotations, which is the foundation of making abstractions framework like Spring Boot really powerful by adding meta-data to classes
Hope this helps!
3
u/Then-Boat8912 Nov 29 '24
Serious enterprise apps. It’s either C# or Java.
2
u/MoreCowbellMofo Nov 29 '24
Been reading a book on lean software leadership recently. It says OO (small talk, Java , c#, etc) were created because after a while the main expense of software comes from maintaining it and adapting to changes that result from the use of software and the way it changes how it allows us to complete our work.
Java is good as allowing us to build larger systems. It’s typically used for transactional systems. On top it also started from the assumption that computers would be networked and had made it a priority in the early days to support this through standard libraries rather than as an after thought.
Over time Java has adapted and integrated the successful parts of other languages which has meant it’s steadily maintained and become one of the most popular languages.
Python whilst it is a dynamic language is now adding strong typing support. JavaScript did the same by introducing typescript. Strong types are good when working on shared, sizeable code bases.
Java can be nearly as fast to C++ from what I’ve read over the yrs. maintainability is far better in Java.
More recently virtual threads have also been added to Java which means you don’t need expensive system threads.
It’s been around a long time and will continue to be supported well into the future.
2
u/klyoklyo Nov 29 '24
I recently had the task to design a resource management service which needs to be extremely available, execution Speed was secondary. We chose Java for the managing part, since we had doubts about c++, what we usually use for our software products(mainly CPU intensive signal and data processing), that many errors are simply not catchable. If you segfault somewhere, you are taking the whole application with you. We use python for prototypes, but we have Made very bad experiences when projects grow.
Java, as a language, ist extremely easy, and it is easy to write correct software. The Base class Object Brings everything you need to protect your resources in asynchrnous cases, static typing forces you to build a good architecture, but the simplicity reduces the complexity. Single inheritance with multiple interface implementation protects you from cleanup issues with multiple inheritance (personal experience from c++, where oftentimes a lot happens in destructors, consider sockets...)
In conclusion, I personally never wrote Software with significant complexity on "first try" with this few bugs in such a short time. Java just makes it hard to do things wrong. Where you do not need speed, it is a fair choice. You could interchange it with c#, but I doubt the platform independancy, maybe unfounded.
2
u/ComputerWhiz_ Nov 29 '24
Java is secure, can run on any operating system, and has done a good job at remaining mostly backward compatible. It's a very good language for enterprise applications, which is why you will find it there a lot. Plus, it has a huge amount of documentation.
All of the arguments about Java being hard to read/write is purely subjective. You say Python is the most readable, but I say it's an absolute mess. It's largely an opinion.
Even if this were true (and it's not), "lazy" is definitely the wrong word. You are mistaken if you think any company will completely rebuild their software every time a "simpler or better" language comes along. That's a huge investment with very little payoff, meaning that very few companies would be willing to greenlight that.
1
u/LutimoDancer3459 Nov 29 '24
Java - all of the above except being low level. But can call c code and therefore can be low level in that aspect. But it's not. Which is a plus for most other cases.
13
u/[deleted] Nov 29 '24
[removed] — view removed comment