Java is very fast. Java is very secure. Java has a gazillion of great code libraries. Java has static typing to save you from stupid coding errors. Java does not use whitespace for logic. need more? Answer from team_broccoli on reddit.com
🌐
Reddit
reddit.com › r/learnpython › "python vs. java in 2025: which should i focus on?"
r/learnpython on Reddit: "Python vs. Java in 2025: Which Should I Focus On?"
December 10, 2024 -

It's 2025, and I'm at a decision point in my programming journey. I want to dive deep into one language and can't decide between Python and Java.

Here's my context: i am a developer with 10 year experience in java and 5 years in python

  • Python: It's dominating fields like AI/ML, data science, web development, and automation. With its growing libraries and frameworks, it feels like a must-know for cutting-edge tech.

  • Java: Despite being older, it's still a powerhouse for enterprise systems, Android development (with Kotlin in the mix), and large-scale backend solutions. Its stability and performance are undeniable.

🌐
Reddit
reddit.com › r/learnprogramming › suggestion: should i learn python or java?
r/learnprogramming on Reddit: Suggestion: should I learn python or java?
August 3, 2024 -

Hi! I'm a junior DevOps engineer and I would like to start developing backend too. I already know intermediate python and worked a little bit with django and I would like to dive deep into python and learn it well.

I asked my supervisor for his advice and he thinks that it's better for me to learn Java first. From his point of view Java is more technical and I can become a better developer by learning the fundamentals with it (like polymorphism, interfaces, data types). He considers python as an uneffective shortcut to learn bad software development practices.

At first he convinced me with his argument but then I documented myself better and I saw that even python has all of those concepts, so I feel like if I'm not lazy and l study python well I can achieve the same expertise I would get with Java.

Since I want python to be my main language I'm essentially very skeptical in using my energies in learning java from zero while I could dive deep in python and get solid with it. It's not like I only want to know python overall, but reading a book of 1600 pages like "learning python" takes time and effort and I feel like I want to make that effort on python, not java.

What do you think about it? I could really use your advice, thanks a lot in advance.

Find elsewhere
🌐
Reddit
reddit.com › r/java › do you find java more aesthetically pleasing than python?
r/java on Reddit: Do you find java more aesthetically pleasing than python?
January 25, 2024 -

I have been programming for about 5 years now, and I started with Java then moved to Python before returning back to using a bit of both. After getting a good tour of Python, I have come to appreciate the static typed nature of Java. I find the way OOP works in Java to be much more aesthetically pleasing to look at than python code. Of course, there are exceptions to this rule when concepts get more complicated.

🌐
Reddit
reddit.com › r/learnprogramming › learn java or python?
r/learnprogramming on Reddit: Learn Java or Python?
June 6, 2023 -

Hi,

I am a university graduate who would like to change my career to IT. I want to apply for a requalification course and basically I have two options available - both courses are "Programmer of web applications" - one is in Java and the other is in Python.

I need some help from someone who knows the industry and the pros and cons of choosing either language. I have read a lot of articles and watched youtube videos and it's practically 50:50. I am leaning towards Python though.

I know your first question will be: What do you want to do in IT?

But that's the problem, I don't know. I have never worked in IT and I haven't experienced different types or jobs to be able to know which I like the most. It's like asking me which food from the menu I liked the most before I had a chance to taste it. I like design, so possibly frontend. But I am open to anything. I think fullstack would be a good skillset to have to find lots of work?

What I know:

Java is more complex to write, harder to learn for a beginner. It is used in web development, Android and in a lot of big companies. It is supposedly harder to change fields in IT if you know Java. The popularity of it is slightly decreasing and the community as well (from what I've heard).

Python is easier to write and read, is used in machine learning and AI and databases. Generally slower than Java to execute, has more potential when you are trying to change fields in IT as it is more widely used.

That's what I know. What I need, is help with this question: As someone (a teacher) who is trying to change career and do something that will enable me to find work easily, which language should I choose to learn to open myself to most job opportunities, something that will be a good start, give me most options for the future and will not lock me in in a specific field, should I realise I do not like it. How should I make a decision? Can you tell me in more detail which language is used in which specific types of jobs and what kind of stuff I could do should I learn Python/Java?

Thank you in advance!

Ben

Top answer
1 of 2
5
Java is more complex to write, harder to learn for a beginner. It is used in web development, Android and in a lot of big companies. It is supposedly harder to change fields in IT if you know Java. The popularity of it is slightly decreasing and the community as well (from what I've heard). True that Java has way more boilerplate than Python due to the full Object Oriented paradigm. False that it is more difficult to change fields False that the popularity is decreasing as well as the community. Java is the enterprise language #1 and stays there simply because there is already way too much Java out there Python is easier to write and read, is used in machine learning and AI and databases. Generally slower than Java to execute, has more potential when you are trying to change fields in IT as it is more widely used. Python has way more use cases than you list for it. The very web site we are communicating on is running on Python Yes, it is somewhat slower, but it can use precompiled fast libraries written in C/C++ for speed Python does not have more potential when changing fields and is not more widely used The above said: yes, it is a 50:50 chance. I would say that learning Java makes you a better programmer, though. Python abstracts way too much and has too many "convenience features". Don't get this wrong, though. Python is a great language, but so is Java. If you haven't been exposed to programming, I would still suggest Java. The expressive nature, verbosity, explicit static typing, excellent tooling, and excellent elaborate error messages make it an ideal first language, even though the very first steps are more difficult. Python on the other hand has an extremely easy entry, yet, the implicit typing can cause problems that beginners will easily stumble over and then be left dumbfounded. The error messages have improved lately, but still are by far not as clear as Java's. Yet, don't overthink the whole. The first language you learn will definitely not be the last and every consecutive language will be easier. In the beginning when you start from 0 you are battling at two fronts: you are battling with the vocabulary and grammar of the programming language (the easier battle) and you are battling with creating detailed step-by-step algorithmic solutions to problems (actual programming - the difficult battle). Once you understand that learning a programming language only is a necessary evil to tell the stupid computer what we want it to do and that the actual programming, namely analyzing and dissecting problems and then developing detailed step-by-step algorithms to solve that problems are two distinct, decoupled activities you will also see that programming languages are just tools to express trains of thought. Once you can program, the actually used programming language becomes secondary. Sure, the paradigms, the vocabulary, the grammar will be different, but if you know what you want to express, you can do it in any language. Developing the "what" is the tricky part. It is a bit like learning a spoken language with very restricted English-like vocabulary and grammar and writing a comprehensive fully developed novel in said language.
2 of 2
2
Remember, that no matter what you choose, it won't define your career for years to come - no matter if you start with Python or Java, you can always learn the other, or a third language in far less time than it took to learn the first. Programming is much more about problem solving and understanding computers, than specific languages. I would recommend Python, because you'll fairly quickly be able to build stuff with it. No matter if you are interested in web-applications, desktop games, scripting, data science or something completely different. Java tends (or tended) to give you a better understanding of Object Oriented Programming, because it is very strict about everything being a class, and so on, and the entire API is extremely Object Oriented, with big-Os :) But in later years a lot of this OOP strictness is becoming annoying, you tend to write a lot, and I mean a lot of extra code, simply to make the Java compiler not throw up on you. And even the folks behind Java has realized this, and newer versions include more and more short-cuts for writing more compact code ... Anyways - as for jobs, I guess it depends a lot on where in the world you live and work. Here in northern Europe, Java is mostly used by banks and insurance companies - there are a lot of Java-code running out there, but it seems like no new products or new companies base anything on Java. Also the banks tends to want university masters with 5-7 years of experience ... But again, it doesn't matter - when you have learned some programming, you'll quickly get ideas as what you want to build, and maybe you need to learn Swift or Kotlin or React or C# to build those kind of applications, but that is the way it is going to be, there'll always be more to learn, so might as well just get started, and have fun along the way!
🌐
Reddit
reddit.com › r/learnprogramming › main differences between python and java
Main differences between Python and Java : r/learnprogramming
April 9, 2022 - There are lots of differences, some on the surface and some deeper. For example, where Python uses white space to delineate blocks, Java uses braces. The biggest difference IMO is that Java is statically typed vs Python which is dynamically typed.
🌐
Reddit
reddit.com › r/learnprogramming › should i learn java or stick to python?
r/learnprogramming on Reddit: Should I learn Java or stick to Python?
August 24, 2019 -

I have been studying programming for the last six months. For the first four months I studied Python, and then I started studying studying data structures and algorithms. For data structures and algorithms, I picked the books where the code was written in Python. Now that I am about to finish that, I have decided to pick Algorithms by Robert Sedgewick. In this book all the code is written in Java.

I want to learn both Java and Python, and I will learn Java at some point. My question is whether I should start learning it right now or not? I know it's not necessary, but I think it will be much easier to follow the book if I have some understanding of Java.

Why am I confused?

Well, I have watched videos, read blogs about people recommending to stick to one language when starting out. So, I am scared to start a new language thinking I might forget Python or get into a situation where I don't understand either of these languages.

🌐
Reddit
reddit.com › r/python › what are the main differences between python and java?
r/Python on Reddit: What are the main differences between Python and Java?
November 22, 2016 - Python is scripted, which means that it is interpreted at run-time. If you have an error, the program will execute until it gets to that error. JAVA is compiled, which means that if there is a syntax error, the program will not run.
🌐
Reddit
reddit.com › r/learnprogramming › java vs python vs c++
r/learnprogramming on Reddit: Java vs python vs C++
May 23, 2023 -

Hey y'all, I'll be needing to choose either one of Java, python, c++ or web programming for my second semester in electronics and communications but i have no idea where to start from

I've learnt all the basics of c programming in my first semester and i have to choose between the above mentioned for the second semester and it's really rattling my brain

Which of them would be better for a beginner to programming language and which would be most helpful in the future, if you'd have to say?

Thanks in advance!

Top answer
1 of 5
264
All of those languages are useful in different situations. Python's very popular with scientists, ML engineers, and the like. Non-programmers who need to write programs love it because it's approachable and has a plugin for basically anything. It's my favorite language for writing tiny, one-off programs and doing hackathons and coding competitions and stuff. Java's the workhorse of the corporate world. If you're writing a giant application full of business logic for a big corporation, and you're gonna maintain it for two decades, Java's still the default choice. C++ is the most powerful option. If you need something to go as fast as it can go, C++ is your default choice. But whole types of bugs around stuff like memory that are basically impossible to cause in Python or Java are really easy to cause in C++, and its error messages aren't so much legible as they arSegmentation Fault (core dumped). You can go far with any of them, and there's a good chance you'll end up learning all three at some point.
2 of 5
88
Love Python, but I’m in the “it’s better as your 2nd/3rd language” camp. The others are ‘harder’ and force you to gain a deeper understanding. Then you can pickup Python super easy. “Oh hey, it basically works the same but just does all the fiddly bits for me”. But you would know what those fiddly bits are, and can check the docs and be certain that behind the curtain it really is doing what you think it is. People who do it the other way around seem to have it harder, they don’t know how much Python is doing for them, why, or that it even is.
🌐
Reddit
reddit.com › r/cscareerquestions › java vs python for backend as a first job
r/cscareerquestions on Reddit: Java vs Python for Backend as a first job
October 26, 2022 -

I will start out (new grad) as a full stack developer in a banking firm.

I have been given the choice to either become a python dev(flask framework) or java dev(spring framework).

Furthermore, I am proficient in Python and flask (my previous internship was with flask) while almost a newbie in java, but I feel being a java developer would help me in the long run.

Would it be beneficial to start my career as a python developer or java developer?

Any advice is really appreciated as my family doesn't have tech background.

Edit: I opted for java but as it is with any big org, they put me in a python team 😂.

Got to work on a data science project and use flask on day to day basis. Since the senior devs in my team are originally java devs, the code base is almost like java with the typing, oop based etc.

I learn new stuff every quarter and I like python. So happy with how fate turned out

Top answer
1 of 25
128
I started with Python (Django) but my first job was Java-based. It was only after using Java that I properly understood OOP. You talk to other developers and you start to understand the importance of object oriented design patterns for scalability and reusability, importance of writing clean code and that alone opens up a whole new never ending pit of infinite knowledge. You'll have very little trouble picking up another language after Java and you'll start to love it's static typed verbose nature. You'll understand the importance being verbose when it comes to really humongous codebase (or atleast, codebase that cover a vast domain)
2 of 25
82
As someone who's worked with both spring and flask, I vastly prefer flask, spring seemed to break every so often with very not helpful errors and in many cases we simply copied the code, deleted the project, then put the code back in and it worked somehow. This was like 5 years ago so no idea if it's different now but spring was extremely annoying. That said career-wise java is the go-to here. Even though I use 90% python now the only reason python is even relevant is packages people have built, mostly written in core C. So for example I do data engineering and afaik there's no pandas/numpy substitute in java. But as a fundamental language I think java is much better and you'll likely learn much better design principles as well. And if you don't like the job after a year or two you can definitely leave and pursue a python role, being able to put java on your resume will only be a positive.
🌐
Reddit
reddit.com › r/learnprogramming › why do people use java and not python?
r/learnprogramming on Reddit: Why do people use Java and not Python?
September 15, 2015 -

I was a young, eager programmer. So I went and learnt Python. I solved some fun problems from project euler and the dailyprogrammer subreddtit. Now, I feel like I have a fair command of the language.

Recently, however, I have been learning how to program in Java, in connection with a college course. I am struggling to see its advantages over Python. It seems to me that one has to produce a whole lot more code compared to the equivalent in Python. So why do people use Java? Is it just inertia due to the fact that Java is older than Python?

Top answer
1 of 5
30
Programmers spend a remarkably small amount of time typing. Judging a program by lines of code (fewer or greater) is entirely orthogonal to the amount of time and effort it took to develop. What programmers do spend a lot of time doing is debugging, and any time you spend in the debugger, adding print statements or using the REPL is time you didn't spend writing features. You need to do everything you can to make your code work predictably the first time. Java does this so much better than Python that it's like night and day: Your code is statically analysed and compiled so you identify bugs before runtime. Stacktraces are the wrong time to find out you made a typo. Static, well defined types are a shared dialect with the computer. You don't get to make up words and expect it to understand you - compiler warnings and errors save you from several classes of bugs. Don't use shared mutable state. Public fields might as well be global variables - and Python has no good encapsulation or privacy mechanic. Magic is bad. Try to follow the principle of least surprise, even if it means breaking your code up into smaller parts with more specific purposes - Java makes it much harder to do the wrong thing and shoot yourself in the face. Some of these principles might seem unnecessarily time consuming to a beginner, but it will help you avoid those headscratching hiesenbugs that really eat up your time.
2 of 5
14
Java vs Python is essentially a matter of tradeoffs. Python is a very expressive language, but without enough discipline, you can end up abusing the features that make Python expressive and end up writing a pile of spaghetti. Java, on the other hand, is often restrictive in ways Python isn't -- it's statically typed, which means that many of the kinds of errors you might miss in Python are going to be caught at compile time instead of runtime. This makes it much easier to catch bugs + write large programs + prove correctness in your code. Java also has a number of other benefits that makes it nice to use on an enterprise scale. In particular, Java is fast -- because Python is a high-level and dynamic language, it's harder for the Python interpreter to figure out how to optimize Python (in contrast, Java is statically typed/restricts the number of weird stuff you can do in a dynamic language). While Python can be fast, it'll usually take more work to get speeds comparable to Java or C programs. In order to get Java or C-level speeds, you usually have to start using libraries written in C (like numpy or scipy), experiment with 3rd party interpreters/compilers like pypy or cython, etc... The other main advantage that Java has is that it has a pretty robust ecosystem -- there's a huge number of different Java libraries available, and there are a bunch of other languages that run on the JVM and can interoperate with Java. This, I think, is one of the main selling points of Java -- it's commonly claimed that Java has a library for almost anything you might want to do. (That said, Python also has a pretty robust ecosystem, so isn't really worse then Java on this front). That said, I also don't think Java is the best language in the world, and I think it has several design flaws that makes it a bit clunky to use. I've previously talked about what I think are the strengths and weaknesses of Java here and here , but to summarize, I think Java has a tendency to be more verbose then it needs to be + is burdened with a number of flaws it can't fix because it wants to maintain backwards compatibility (examples: type erasure, checked exceptions, etc...) Most people still end up going for Java, mostly due to the strength of its ecosystem + because it has a solid track record of scaling well, but if you're really interested in exploring this idea of taking advantage of a strict type system + being able to rely on the compiler to catch your errors, I'd recommend you try exploring either C#, which is like a nicer/more elegant version of Java, or a functional language like F# or Haskell, which takes the idea of typing to its logical extreme. I don't think any of these languages have as robust of an ecosystem compared to Java or Python, and functional languages like F# or Haskell are still a little too alien to the average developer to become mainstream, but I do think they're much more expressive and elegant then Java is. As a result, I feel they do a much better job of demonstrating the strengths of statically-typed languages + why you might want to use them over something like Python.
🌐
Reddit
reddit.com › r/python › why python is slower than java?
r/Python on Reddit: Why Python is slower than Java?
January 3, 2024 -

Sorry for the stupid question, I just have strange question.

If CPython interprets Python source code and saves them as byte-code in .pyc and java does similar thing only with compiler, In next request to code, interpreter will not interpret source code ,it will take previously interpreted .pyc files , why python is slower here?

Both PVM and JVM will read previously saved byte code then why JVM executes much faster than PVM?

Sorry for my english , let me know if u don't understand anything. I will try to explain

Top answer
1 of 42
621
Both Python and Java compile the source files to bytecode. The difference is in how they to run this bytecode. In both languages, the bytecode is basically a binary representation of the textual source code, not an assembly program that can run on a CPU. You have a different program accepts the bytecode and runs it. How does it run it? Python has an interpreter, i.e a program that keeps a "world model" of a Python program (which modules are imported, which variables exist, which objects exist...), and runs the program by loading bytecodes one by one and executing each one separately. This means that a statement such as y = x + 1 is executed as a sequence of operations like "load constant 1", "load x" "add the two values" "store the result in y". Each of these operations is implemented by a function call that does something in C and often reads and updates dictionary structures. This is slow, and it's slower the smaller the operations are. That's why numerical code in Python is slow - numerical operations in Python convert single instructions into multiple function calls, so in this type of code Python can be even 100x slower than other languages. Java compiles the bytecode to machine code. You don't see it because it happens at runtime (referred to as JIT), but it does happen. Since Java also knows that x in y = x + 1 is an integer, it can execute the line using a single CPU instruction. There's actually an implementation of Python that also does JIT compilation. It's called PyPy and it's five times faster than CPython on average, depending what exactly you do with it. It will run all pure Python code, I think, but it still has problems with some libraries.
2 of 42
68
There are 2 things that mostly affect this: Language design and Implementation. Python is designed to be higher level and to be more easy to iterate quickly, for example by it's use of duck typing. Java on the other hand, while quite high level when compared to C, forces static type checks at compile time. This means the Java compiler can do optimizations that Python just can't, because it has more information ahead of time (because it forced the programmer to supply that information) Then there is implementation. At least for python I know a handful of language implementations that vary wildly in speed. CPython and PyPy with it'S JIT compiler come to mind. Many of the speed issues are just a matter of optimization. Java has been optimized a lot about 10 years ago I think? I remember sitting in uni and people talking about how Java has finally become fast ^^. Take this with a grain of salt, I don't enjoy java specifically, I might misremember the time. But Python definitely is getting faster by the year. The "normal" python implementation is working hard on optimizations since about 3.9. One of the things holding python back in many applications on modern hardware is the GIL, because it pretty much makes easy and fast multi threading impossible. There are Python versions without a GIL and there are efforts to remove and/or change it for main python as well. These are just some points and examples that came to mind, there is plenty more (Examples as well as details), we only scratched the surface here. I hope it helped though
🌐
Reddit
reddit.com › r/java › new to programming did i choose the wrong language? java vs python
r/java on Reddit: New to programming did I choose the wrong language? Java vs Python
August 24, 2020 -

Hey guys,

I just started programming with the end goal of one day becoming an programmer one day but the catch is I don't know in what - web development, Android, iOS , ect.

For those who started programming did you already have an end goal in mind of what type of programmer to be?

I chose Java to start off with and been going at it hard but was thinking I should have done python since it's the most popular.

My goal was to go deep in one language and just learn the ins and outs of it to understand programming but chose Java for some reason but realized the python community is larger.

Am I approaching this wrong ? Any insight and Input????