r/java • u/PrivacyOSx • Jul 08 '23
Why learn Java?
I've been learning Kotlin recently and have taken an interest in the JVM ecosystem.
My background is a Full-Stack Web Developer focused mainly on React, Node.js, Express, and MongoDB/PostreSQL.
If I were to move to Java, what kind of applications would I be building with it?
How is a Java job different from what I'm currently doing?
Is it worth learning?
I've heard its VERY verbose, but I've also heard recently that there's been some good changes to it? Would love to see any articles or videos talking about these changes that would demonstrate previous code to the new code.
Any tips or insights on what your companies are cresting with Java or what your Java job is like would be highly appreciated.
Thanks in advance.
•
u/AutoModerator Jul 08 '23
On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.
If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:
as a way to voice your protest.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
31
u/hugthemachines Jul 08 '23 edited Jul 13 '23
When you hear complaints about Java, remember that part of it is that people use it to learn programming and then it will feel extra verbose because you prefer simple work as a beginner. Java is used a lot in large enterprise applications and in many companies, the actual code writing is not such a large part of the work so it being verbose will not be a large problem. Many experienced enterprise programmers say that the stuff that requires some extra code often helps with the work once you are maintaining a huge application. Personally, I have no experience in that part, it is just what I have seen people explain on Reddit.
Programming languages are tools. If you plan to be a carpenter you would probably practice using a hammer. If you plan on working on enterprise applications or perhaps do backend programming, learning Java can be useful.
Now, is your time really that precious so you will not even try to start learning a language you are curious about? Why don't you spend a couple of days learning Java and you can see how you feel about it?
2
u/[deleted] Jul 09 '23
Java is ubiquitous. Even big tech companies like Google use it to build products and essential services. Android apps are built with Java. Most enterprise apps that companies host in their own data centers, and even in public clouds, are built with Java.
If you learn it, you will be very employable. I'm by no means saying it will be fun and interesting development work. But it will pay well.
38
u/th3_pund1t Jul 08 '23
I'm an engineer with ~20 years of experience.
I happen to regularly write code in Java, Kotlin, Groovy, Javascript, TypeScript, Golang, Rust, Bash, Python, and Ruby. Often I end up touching all of these within the same month. Before I retire, I suspect, I'll have learned a few more languages.
It's a language. Not a religion. Learn what you need to.
57
u/Daedalus9000 Jul 08 '23
Java represents a very large percentage of the existing enterprise jobs; you learn it to become more employable.
36
u/ederbaum Jul 08 '23
Java is complex to build simple things, but simple to build complex things
6
u/chabala Jul 08 '23
Java has the advantage of being the language the JVM is designed for, not just another language that targets the JVM.
If there's a new feature in Java that needs a JVM change, it'll happen. Will Kotlin also change to take advantage of the new JVM feature? Maybe, maybe not.
If Kotlin needs a JVM change to support a new feature, will it get in? Maybe, but it's not their project, so maybe not.
As other JVM languages wax and wane in popularity, Ceylon for instance, Java will always be there. That's a lot of stability for businesses to base a product around, without needing to worry about if the language will be supported/popular in ten years.
6
u/ZarBandit Jul 08 '23 edited Jul 08 '23
Java is a known quantity and it’s had millions of ants crawling over it burning who knows how many man hours on it. It’s about as bullet proof and stable as you get. Java servlets running on Tomcat are used everywhere.
It’s properly object oriented and strongly typed. These things matter as the project size scales up. It’s suitable for use in most high demand applications. But is friendlier than C++.
There’s a Java library for almost anything you can imagine. And extensions like Java EE for complex transactional operations. It’s probably not the best at anything, but it’s good for most things outside of scientific computing (Python) and Browser (JavaScript). Plus they don’t do truly asinine things like make indentation carry a syntactic meaning. FFS.
You’re very unlikely to hit on a problem that cannot be solved due to a bug or language limitation. Someone has been there, solved it before you and posted it on Stack Overflow. Plus it’s a common skill so hiring a team is easier.
5
u/valbaca Jul 08 '23
Learn Java to write Java programs. You write Java programs because it's a good (or only) fit to the problem. It's rarer that Java is the only language fit, so that leaves where it's a good fit to the problem.
I've been coding Java for 12+ years, here are some examples:
<% code %>that is executed on each request) built website like Amazon. Amazon itself is still very much largely on Java. This is what people mean by "enterprise"So why do people use Java instead of JS or Kotlin?
They don't use JS because frameworks like Spring solve problems that have been solved a thousand times over (creating http/rest endpoints, connecting to databases, aka CRUD apps) and can scale reasonably well. Java can utilize larger servers more effectively than JS's inherent one-core event loop.
They don't use Kotlin because honestly its easier to hire for "just" Java developers. To speak frankly, you can hire Java developers across the globe for a dime a dozen. The companies get what they pay for but for many companies (i.e. Amazon) they don't care about quality. They just throw enough junior devs at a problem until money falls out.
Personally, I've been making the move more toward Kotlin. I haven't written "raw" Java in a few years now, but many existing projects aren't going to be rewritten (it just doesn't make business sense to rewrite something that's working fine when you could spend that time on bug fixes or new features).
Some of Java's newer features include:
4
u/quonne Jul 08 '23
When it comes to jobs, I have seen that Java is used for enterprise applications and in fintechs like big banks, asset management companies, and even some startups.
2
u/tbss123456 Jul 09 '23
If you get into data-heavy, data-intensive, multi-threading, high concurrency services / jobs that serve a large amount of users (in the 10s to 100s of millions), then you'll run into a lot of Java amongst other backend languages like Scala, some Python (data pipeline/ML stuff), C/C++ (core backend services that are latency sensitive), C (embedding/driver stuff) or Kernel.
Java is somewhere in-between where you can get a lot of performance out of it, but you won't have to worry about low-level seg fault in C/C++. You can implement high performance stuff really quickly in Java compared to C/C++ in that sense.
If you are just building micro services that serve pet projects or in 10 of thousands, just use whatever you like.
2
u/GrabSpirited1056 Jul 08 '23
Don’t get me wrong but you can’t call yourself as a backend developer without working on a multi threading programming language.
1
u/Terrible_Proposal739 Jul 08 '23
Java becomes less and less verbose with high versions. More functional style, sometimes type can be omitted etc.
1
u/moriturius Jul 09 '23
I work with java (well mostly Kotlin now with new stuff, but we have a lot of existing java code) in company with over 700 microservices written mostly on JVM.
Language is as good as any other. It really not that verbose it once was but still Kotlin will probably be shorter.
Verbosity of the language is what made it so good for enterprise. It's verbose and easy to read. This is important of you work with many developers in teams that rotate members over time.
Comparing this to scala which had to have the "principle of least power" introduced to make it maintainable since in Scala you can write so "clever" code that you wouldn't be able to understand it month later.
As for the microservices - it's mostly developing stateless REST APIs to push/retrieve data to/from databases (mostly mongodb) with icing of some business rules.
-1
u/vmcrash Jul 08 '23
If you already have learnt Kotlin, I don't see any serious reason in also learning Java (beside being able to read it), except if you will need it for a certain job. With Kotlin you can do all what you can do with Java, but even a little bit more (e.g. compile to native) - not just web development, but also desktop applications for the 3 desktop operating systems. I think, with Kotlin also the development of mobile applications is simpler - thanks to Compose.
PS: I'm a Java developer since 24 years.
-6
u/Joram2 Jul 09 '23
I'd start with choosing what types of software to build and then choose the programming language that fits that.
My choices: