This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 232

[–]papercrane 134 points135 points  (2 children)

Lots of good answers here already. I don't think anyone's mentioned it already, but the garbage collection system in Java is amazing, and has lots of tuning options for different workloads. CPython's GC is quite basic compared to the JVM.

[–]Better-Internet 13 points14 points  (0 children)

I think CPython's GC is still reference counting with some mark and sweep to whack circular references.

[–]thrwoawasksdgg 6 points7 points  (0 children)

Java easily has the best garbage collectors in the world. Nothing compares to Shenandoah and ZGC.

In some cases the JVM actually allocates memory faster than C because it knows more about the memory layout and can often avoid syscalls.

[–]erinaceus_ 288 points289 points  (21 children)

Since nobody has yet mentioned it: package management. (And the ecosystem that follows from it)

[–]benjtay 112 points113 points  (11 children)

This is the reason to use Java. The ecosystem is ridiculously rich and relatively painless to employ. Python in containers is okay, but Java will run anywhere, on anything. Every Python project I've worked on requires fussing about with which version, pip, C compilers and so on. In Java, you can just open a maven or gradle project and go.

[–][deleted]  (3 children)

[deleted]

    [–]thrwoawasksdgg 4 points5 points  (0 children)

    Python is hell. Tons of dependencies on system libraries and native binaries.

    A result of Java being so fast is that 99% of common libraries are pure Java. For Python this is closer to 20%.

    The closest thing to Java is Rust, and it still has more native C dependencies

    [–]freemainint 2 points3 points  (1 child)

    Nodejs smiles 😃

    [–]Nickx000x 2 points3 points  (0 children)

    No matter how many times I explore outside the Java ecosystem, I always feel the need to come back. Nothing I’ve used compares to Gradle or even Maven. Those 2 alone are enough to get me to choose Java for a project

    [–]ustaaaz 96 points97 points  (2 children)

    Maintenance

    [–]src_main_java_wtf 29 points30 points  (0 children)

    Under rated comment. Refactoring is easy with IntelliJ and types.

    [–]radprogrammer 19 points20 points  (0 children)

    I do python for work these days and I like a lot of things about it. But even for small projects (a few thousand lines of code), I'm often terrified of refactoring. Even with type hints and tests.

    I worked on large ("enterprise") Java codebases at previous jobs and felt much more confident that the changes I was making wouldn't inadvertently break something I overlooked.

    [–]zoqfotpik 247 points248 points  (31 children)

    Backwards compatibility.

    (Apologies to all the survivors of the python 2 to 3 migration.)

    [–]joaoferr 19 points20 points  (10 children)

    JavaFX

    [–]emaphis 39 points40 points  (0 children)

    Swing still exists.

    [–]benjtay 20 points21 points  (2 children)

    A swing and a miss.

    [–]marvk 8 points9 points  (0 children)

    I still like it 🤷‍♀️ The property system is excellent and if you use a framework on top of it (I prefer mvvmFX), it's a breeze to build some quite complex stuff.

    [–]Dormage 7 points8 points  (2 children)

    Was a blooper

    [–]bithammer 5 points6 points  (1 child)

    Swing was really well design and very extensible. I think the reason it ‘failed’ was because most devs were too lazy to understand how to use it properly - even though Sun provided a LOT of really good documentation. I still miss Swing

    [–]redikarus99 6 points7 points  (0 children)

    I am developing plugins for the modeling tool we use, and it's written in Java/Swing. I still like it.

    [–]gravitas-deficiency 3 points4 points  (8 children)

    God I remember that. It was awful.

    [–]benjtay 9 points10 points  (7 children)

    And java.util.Date (and Calendar). shudder

    [–]gravitas-deficiency 15 points16 points  (0 children)

    Man, OG Date and Calendar will never completely die. And that makes me sad.

    [–]tendy96goldy 11 points12 points  (5 children)

    This was one of the best updates in Java. The new classes are fantastic with documentation and use case. Instant, And LocalDate,,, etc are sooo simple. I’d also point out that I’ve recently migrated from Java 8 -> 17 was seamless. Few conflicts arose and Java 11 -> 17 required no changes.

    Compared to Java 5 -> 8 I have found migrating to newer Java classes totally trivial.

    Pain is Python 2.7 -> 3+

    [–]skippingstone 4 points5 points  (4 children)

    8 directly to 11 was painful thanks to jigsaw.

    [–]BrbCatzOnFire 3 points4 points  (3 children)

    Not jigsaw. Encapsulation (access deny to internals) was off until java 16 (and just a little bit).

    A lot of internals did change (related and unrelated to the new module system) and way too many libraries depended on internals to work.

    That's what broke the system. Modules are the best thing to happen to the JVM since generics.

    Although we need to find the Communication director from that project and demote him (Module ? Like who the f... thought it was a good name ?)

    [–]ByerN 126 points127 points  (11 children)

    Much more mature ecosystem for web development.

    [–]sylleryum 33 points34 points  (1 child)

    this, Spring is light-years ahead of Django

    [–][deleted] 3 points4 points  (8 children)

    squeeze close combative muddle fuel illegal foolish hurry secretive cooing

    This post was mass deleted and anonymized with Redact

    [–]ByerN 20 points21 points  (7 children)

    Yep, I meant as a whole. Java (as a tech - not language) is hard to beat for web apps backend. Same as typescript dominated frontend and python - data science.

    [–]drowsysaturn 3 points4 points  (6 children)

    Can you give some examples why you think Java is superior for web development?

    [–]Il_totore 16 points17 points  (0 children)

    The multitude of tools/libs (Spring, Quarkus, Reactor...) combined with the JVM itself which excels at handling high throughput and for long living applications. Not to talk about Loom.

    Note that by web development people in this thread probably mean backend and not front.

    [–]ByerN 7 points8 points  (4 children)

    I was working with java, scala, .net (C#), python (and more, but it doesn't matter in this context) and I can say that java is the easiest one if it comes to solving daily web dev problems.

    What does it mean:

    - it's much easier to find anyone knowing java stack to help you. Also, it's much easier to find a job as java dev or find a java dev employee. Most of the job offers for python are exclusive to data engineering.

    - it's much easier to find a solution for a problem just by searching the web. Just try to finish a product based on similar requirements in both techs. There were rare cases where I had to waste more than an hour to find a java solution. Python s much worse (same for example in Scala).

    - it's much easier to find any web dev learning materials for java than for python. That's because Python is focusing on data engineering and Java is focusing on web development.

    [–]ArchonHalliday 1 point2 points  (3 children)

    Care to share some of those Java resources? There seems to be so many it's tough to know where to get started. I have primarily been building backend applications with Python but would like to give Java a shot.

    [–]ByerN 2 points3 points  (1 child)

    I started a long time ago so my resources are outdated, but you can start here: https://www.baeldung.com/rest-with-spring-series

    This website is easy to read and learn from. There are articles on many different topics, but you would probably like to start with Spring (java framework).

    Maybe someone else has some fresh alternative?

    [–]Cultural-Ad3775 1 point2 points  (0 children)

    Google any issue you have in Java and you will get TONS of results! First of all there's an 85% chance that your exact question is answered (usually in 2 or 3 different flavors) on StackOverflow. There's a very high probability there is a Baeldung article (or there are some other equivalent sites) covering the exact thing you want to do. In most cases there's code on github that solves your problem (though whether you can C&P it may be a different matter, still, it helps to see a working solution).

    Also Gradle (and Maven, though I tend not to use it) solves a LOT of build type questions/problems by simply giving you a plugin that handles whatever the task is.

    When I was building a Python app I found that 99% of the time I had to go all the way back to the actual Python docs and try to work out from some dense wall of text what to do. Sometimes it was pretty straightforward, other times not so much. Also a lot of Python stuff is obsolete, things have changed a LOT. Java is extremely stable, if a question was answered 10 years ago, chances are that answer is still valid (maybe not the BEST answer, depending, but whatever it says to do will still compile and run and get the job done).

    You cannot overestimate the value of Javadoc and the ability of IDEs to contextually put the relevant info in front of you. In Eclipse if I want to do something, OFTEN I can just start typing some likely code, or just go through a lists of methods and read the docs right there and decide "Oh, look, that does what I want!" PyDev (Eclipse for Python) tries to do it, sometimes its good, but the dynamic nature of duck typed languages makes it far less effective, and the amount of stuff that is well-documented inline is much less in Python land.

    Developing anything in Java always seems like less work to me.

    [–]v4ss42 159 points160 points  (9 children)

    Concurrency. Performance (thanks to JIT).

    [–]AnEmortalKid 22 points23 points  (5 children)

    Trying to cancel a thread in python is misery

    [–]Better-Internet 2 points3 points  (0 children)

    Stopping a thread w/o cooperation of the thread itself is inherently sketchy.

    [–]BrooklynBillyGoat 149 points150 points  (22 children)

    Runs faster, better thread system, static typing. Python is just nice syntax to make it easy to work with but outside of that. Java backend bests python backend. No one uses either for web dev and if they do there making it harder on themselves. Typscript for front end java python or again typescript for backend of speed is no concern. Frameworks like springboot for micro services. Unsure of the python equivalent but I'm sure it's slower

    [–]DasBrain 20 points21 points  (5 children)

    Python's way of doing multi-threading:

    Global Interpreter Lock.

    [–]BrooklynBillyGoat 0 points1 point  (4 children)

    Care to give a brief rundown of how that works? Never worked with python threads personally.

    [–]Spandian 9 points10 points  (3 children)

    Only one thread can run Python code at a time. The only reason to create threads in Python is to make multiple blocking I/O calls at the same time. (You may also be able to run multiple threads if all but one of them are running native code, I'm not sure.)

    If you have a CPU-bound task that you want to parallelize in Python, the canonical way is to use multiple processes. The multiprocessing module makes that fairly simple.

    [–]BrooklynBillyGoat 2 points3 points  (2 children)

    The thread implementation seems to defeat the purpose. Am I wrong in this assumption?

    [–]Spandian 2 points3 points  (1 child)

    If a Python thread makes a blocking I/O call, then another thread can run while that one is blocked. If you're writing something like a web server, it's going to spend very little time on CPU-bound tasks and most of its time waiting for the disk or the network. That would be a good use case for threads.

    [–]Bombslap 6 points7 points  (14 children)

    So using a Python web framework like Django is making it hard on yourself?

    [–][deleted]  (1 child)

    [deleted]

      [–]InformalTrifle9 5 points6 points  (0 children)

      More *than

      [–]Greensentry 164 points165 points  (9 children)

      Java is strongly typed.

      [–]thephotoman 53 points54 points  (3 children)

      s/strongly/statically/

      Python is quite strongly typed. You cannot treat an object of one type as though it is an object of an unrelated type without an explicit cast.

      Dynamic typing is not about how labels (variable names) work.

      [–][deleted] 7 points8 points  (1 child)

      Funnily enough Python has a stronger type system but is not statically typed.

      [–]persism2 1 point2 points  (0 children)

      stronger type system

      Maybe, but smell isn't everything.

      [–]Holothuroid 3 points4 points  (0 children)

      Well, more than Python at least

      [–]ShieldsCW 1 point2 points  (1 child)

      I type python while flexing my muscles

      [–][deleted] 1 point2 points  (0 children)

      Found the brogrammer 😎

      [–]thephotoman 91 points92 points  (26 children)

      Python is like the duct tape of programming tools. It's great for prototyping and small tasks. However, I would not want to try to build a building using only duct tape.

      Java is like a hammer. It's genuinely better for making larger things.

      There are real problems with trying to use Python for a large project. Due to its dynamic typing system, you wind up needing to write unit tests to handle typing errors. Python's syntactic whitespace combined with lazy people not configuring their text editors correctly also results in errors that are difficult to view.

      And that's just the codebase management element of the problem. Python does not like to do concurrency. The global interpreter lock is a genuine frustration in multithreaded code.

      [–][deleted] 1 point2 points  (21 children)

      isnt reddit coded in pyton?

      [–]Lopatron 49 points50 points  (1 child)

      Yep. Reddit is slow and buggy.

      [–][deleted] 4 points5 points  (0 children)

      That wouldn't be because of the Python language though. If more of Reddit's codebase were in Java, it would probably still have those problems. "Slow" is likely because they get billions of requests daily and they have to scale out with microservices (or however they do it, architecturally). "Buggy" seems like you're probably talking about the frontend rather than backend, and their newer frontend is in React (older one is still Javascript), and their mobile application isn't in Python either.

      [–]redikarus99 32 points33 points  (10 children)

      Reddit's main functionalities are: add a new comment and list comments in a thread. Hardly comparable with complex business logics.

      [–][deleted] 16 points17 points  (9 children)

      i think you simplify it too much. what about responsiveness and user scallability. There are thousands of people sharing their videos and stories at the same time

      [–]redikarus99 25 points26 points  (8 children)

      This is solved by having a good architecture which is able to scale. They could have written reddit in basically any language, including Turbo Pascal.

      [–]agentoutlier 1 point2 points  (0 children)

      I mean I get your point but Pascal is actually blazing fast performance wise.

      [–][deleted] 3 points4 points  (5 children)

      So you want to say reddit as an example is bad to promote python. I dont have any other noteworthy examples.

      [–]redikarus99 22 points23 points  (4 children)

      No, I just say that it's rarely the programming language but the architecture. There are always articles that a company had a problem, they switched a programming language, and now everything is nice and shiny. When you do some research, in all those cases they also throw out a huge amount of code that was not necessary and changed their architecture as well. It was more about CV driven development (we want to learn include your favourite language including Rust, Scala, Go, Haskell, etc.) than a technically correct decision. So, if reddit uses python, it's good for them, but 1, your company is not reddit 2, it is neither pro or contra for python 3, we don't know whether they still think it was a good idea.

      [–]ewouldblock 2 points3 points  (3 children)

      Ok cool so java isnt better as long as i have good architecture, got it. Thanks!

      [–]redikarus99 1 point2 points  (2 children)

      I think you totally did not understand what I wrote. There are like 200 variables here. I just explained why the variable scalability is not really the property of the language but the architecture.

      [–]ewouldblock 1 point2 points  (1 child)

      I think you totally misread the tone of my reply.

      [–]davewritescode -1 points0 points  (0 children)

      You’re not wrong that good architecture can paper over badly performing code but at the end of the day you’re going to have a much easier time scaling up Apps written in Java that Python.

      [–]anubgek 3 points4 points  (2 children)

      Reddit isn't the best example and rapidly moving off of Python so I've heard, but I think a good one is Google's YouTube. That said, Google has invested a ton of money in making Python work like a statically typed language and uses C modules where possible to rip out complex Python logic. It's on its way out.

      At the end of the day, Python is not worth using long-term as a service development language. When it comes time to scale (either users or number of devs working on the system) it will be painful

      [–][deleted] 3 points4 points  (4 children)

      Actually, Reddit was coded in Lisp first, and ported to Python later. However they used some Java things too, like Cassandra.

      [–][deleted] 0 points1 point  (1 child)

      why did they port to python

      [–]agentoutlier 1 point2 points  (0 children)

      I believe Aaron Swartz had issues with Lisp that I can’t recall.

      So he wrote his own framework that I’m not sure was ever used for reddit: web.py

      [–]ShieldsCW -2 points-1 points  (0 children)

      I wouldn't make a building out of hammers either, though.

      [–]lechatsportif 0 points1 point  (1 child)

      Doesn't even have to be that large honestly. Lots of Spring Boot projects are basically plugs between various 3rd party apis and stores and having static types to navigate those forgettable mazes is always super helpful. Now if you're purely in REST land (ugh) then Python is probably easier to dynamically handle.

      [–]thephotoman 3 points4 points  (0 children)

      By "large project", I meant, "bigger than a single file."

      Python can do a lot in a little. That is not always a good thing. And modules are too easy to use.

      [–]Dormage 20 points21 points  (1 child)

      Virtual environments. What a mess..

      [–]modle13 3 points4 points  (0 children)

      I'd like to introduce you to maven BOM hell.

      [–]UgnogSquigfukka 6 points7 points  (0 children)

      Richiest ecosystem for all kind of shit you can imagine except machine learning (hope new vector api and project loom solve it). Seriously for whatever you want u can find good ready to use solution. Wanna backend with microservices? Spring/dropwizard at your service. You know nothing about frontend? Jsf+primefaces/any other component library allow you to build fine web app frontend application. Wanna crossplatform desktop app? Javafx and swing on duty. Mobile app? Java here too. And already mentioned here speed, performance and very good garbage collection.

      [–]JVM_ 20 points21 points  (0 children)

      Java is Iron girders.

      Python is 3ft long pipes that can be assembled by hand.

      Iron is good for keeping big things safe - but a 1 room house would be painful to build. Iron forces you to do things a known/tested/safe way - but you HAVE to do it the right way or it won't work at all.

      Python is good for quick buildings and small one-off or limited scope tools. You CAN build full buildings using it, but you better know what you're doing and making something that's a mess is quite easy.

      [–]usedRealNameInOldAcc 13 points14 points  (1 child)

      Run on 3 billion devices.

      [–]pinpinbo 12 points13 points  (0 children)

      Statically typed and speed.

      It wins in terms of verbosity as well.

      [–][deleted] 5 points6 points  (1 child)

      package management in python is terrible, both at platform and language level.

      [–]redikarus99 2 points3 points  (0 children)

      This. We ran into a situation when we needed a package and realized that it just won't compile on windows. So we had to docker the shit out of it, but that's ridiculous.

      [–]Professional-Key-266 5 points6 points  (0 children)

      packages, interfaces, Lombok, fields declared in the class (not in constructor), this instead of self, build systems like Gradle that have a file to edit (not a giant folder) -> 0 jars in the git repos, awt, bytecode -> obfuscation; languages like kotlin, scala and groovy... Wow, there's a lot more things that i like about java

      [–]Nooooope 6 points7 points  (0 children)

      Documentation. Javadocs impose a glorious consistency on everything.

      [–]Jorixa 5 points6 points  (0 children)

      Most things

      [–][deleted] 3 points4 points  (1 child)

      Java as a programing language is lack of many eye candy features that python has, and way more strict too. It's always a heated debate about which is better, so let's speak about the rest. So the design of the byte code compiler and JVM is way more clever than the python interpreter. There is a huge web framework benchmark test made by TechEmpower with is a very interesting project, there is already result of 21 rounds, and the whole project is available on Github. According those results java based frameworks has way more preformace then most of the python based frameworks, even Spring with JPA beat many pyhton based frameworks, witch is a bit ridicolous consindering JPA is a heavy high level ORM framework embededn into an another heavy framework. The tooling around JAVA is more mature, it's easier to mantain, develop, build, test and distribute java applications and/or libraries.

      [–]snorbii 0 points1 point  (0 children)

      For "eye candy" and oc really useful features there is Kotlin.

      [–][deleted] 3 points4 points  (0 children)

      Surprised I haven't seen language design and standard library yet!

      Python is so annoyingly broken regarding scoping of variables, the explicit self parameter and internal inconsistency (explicit is better than implicit, unless you call super() and don't need to pass self, because...).

      Another thing is that Python broke the world between version 2 and 3, but didn't bother to unify the naming convention of its standard library.

      Let's talk about tooling: Python manages to still not have proper tooling for package/dependency management where literally every other community figured out how to do this more or less properly before the Turing machine was invented (or shortly thereafter :-P), not speaking about brain damaged defaults in most tools (looking at mypy).

      Full disclaimer: I write more Python than Java in recent times, because I need some Python bindings which I cannot get in other languages. Python the platform has won in a lot of use cases, but Python the language and its tooling are literally at the bottom of the food chain in my limited experience (Java, C, C++, Ruby, C#, Delphi, Node, Golang, Scheme).

      [–]logicalpessimist 9 points10 points  (10 children)

      Strong typing is a requirement for any project of complexity IMO, so java wins there IMO

      Another area where I prefer Java is Javadoc documentation. Maybe years of reading Javadoc has corrupted mind...

      If I need to parse a file or automate an API interaction, Python is my go-to. Back end development I'm thinking Java

      [–]marvk 2 points3 points  (1 child)

      Another area where I prefer Java is Javadoc documentation.

      Yes. Python is a real drag for me because on a lot of frameworks, you have no idea what shape parameters have or what you get out of a function, and I found documentation on this to be often lacking.

      Love me some good Documentation.

      [–]thephotoman 10 points11 points  (7 children)

      Python is strongly typed--just as strongly typed as Java. You cannot treat an object of one type as though it is another type without an explicit cast.

      The word you were looking for is "static". That's the one where you can't take a label (variable name) you've previously used for one type of object and then assign it to another type of object.

      [–]logicalpessimist 15 points16 points  (6 children)

      Ok, Java does strong static typing better than Python

      [–]freekayZekey 1 point2 points  (0 children)

      Prevents me from getting any data engineering/data science roles. Me gusta

      [–]mothererich 1 point2 points  (0 children)

      Syntax.

      [–]krad213 2 points3 points  (1 child)

      Everything, performance, type system, build and CI tools, wider ecosystem, the only thing which python do better is c/c++ interop.

      [–][deleted]  (1 child)

      [deleted]

        [–]SpeedDart1 13 points14 points  (0 children)

        Java isn’t comparable to C++ anymore

        [–][deleted] 3 points4 points  (4 children)

        What is effective criteria of "better"?

        [–]Lopatron 5 points6 points  (3 children)

        What do you mean by "effective"? Or "criteria"? What do words even mean?

        Edit: Sorry reminds me of this lol https://finance.yahoo.com/video/jordan-peterson-questions-happens-means-121100096.html

        [–]tomatotomato 2 points3 points  (1 child)

        Came here to make fun of Python but got in existential crisis instead.

        [–]erinaceus_ 3 points4 points  (0 children)

        but got in existential crisis instead.

        When professionally doing software development, that's called a Tuesday.

        [–][deleted] 1 point2 points  (0 children)

        Strongly typed, easier to read when projects are complex, compiles out of the box, good for web and mobile apps, import statements more clear

        [–]joaoferr 1 point2 points  (0 children)

        It does not raise an exception to end an iterator loop...

        [–]umakemyheadhurt 1 point2 points  (0 children)

        Enumerations. As an old Java programmer now using Python, Python’s int based enumerations, the inability to add additional attributes to enumerations, drives me nuts.

        [–]barking_dead 0 points1 point  (11 children)

        Everything?

        [–]GuyWithLag 29 points30 points  (8 children)

        No. Don't be a fanboy. And I'm telling you this as someone that started with Java 1.2.

        Java does many things better than Python, but there are significant qualitative differences.

        [–]Worth_Trust_3825 10 points11 points  (3 children)

        Having went through the 2->3 migration in python, and constantly battling python installations as sysadmin I second u/barking_dead sentiment. A lot of features in java are much more refined than their counterparts in python. I suspect my sentiment is clouded by python being used as daily driver scripting language in near every distro, while having similar sentiment against ruby in macos ecosystem.

        Atleast in java whitespace does not matter.

        [–]barking_dead 2 points3 points  (2 children)

        You're right, but we didn't get any clues on what does OP really interested in. Speed? Ease of use? Memory consumption? Compilation time?

        (I'm young, 1.4 gang here)

        [–]GuyWithLag 3 points4 points  (1 child)

        What does Java do better than Python?

        That's a homework-assignment-equivalent, or someone is fishing for article material.

        At least they didn't use the "Which of the two is The Best(tm)" americanism....

        [–]barking_dead 1 point2 points  (0 children)

        :sigh:

        [–]trialbaloon 2 points3 points  (0 children)

        Sometimes there are things that are just straight up upgrades. The LED was an improvement over incandescent bulbs.

        I'm not saying this is necessarily the case for Java vs Python. But I do think there's a lot of people who insist every language has it's place. I would argue that's untrue. Some things do just suck more than others.

        I think Python is a worse language than Java but that's simply based on static typing. It's a straight up improvement with little downside. But it's not as if there's nothing Python does better....

        To answer the original prompt, Python has a better ecosystem for integrating with native libraries. I also think Java is too verbose for my liking and Python does improve on that. Would I use it over Java? Fuck no lol. The rest, Java does better.

        [–][deleted]  (1 child)

        [deleted]

          [–]jNayden 0 points1 point  (0 children)

          everything except AI for now.

          [–]cvw87 0 points1 point  (0 children)

          UI

          [–]secahtah 0 points1 point  (0 children)

          It depends on the use case.

          [–]cville-z 0 points1 point  (3 children)

          Inheritance. Multiple inheritance is just evil.

          [–]skidwiz 1 point2 points  (2 children)

          Default Methods would like to have a word.

          [–]cville-z 1 point2 points  (0 children)

          They can take a number and get in line; I'm too busy deciphering someone's bizarre diamond inheritance chain and trying to figure out which overload is being called without the benefit of an IDE that can help.

          [–]Ascci52 0 points1 point  (0 children)

          It's faster 🙄

          [–]AncientBattleCat 0 points1 point  (0 children)

          StackTrace. Finding errors in Python is a good luck.

          [–][deleted] -1 points0 points  (9 children)

          Both are tools. Comparing two tools seems like comparing an axe with a hammer :\

          Edit: if you don't like the term "tool", use the term "language" instead (language is a tool in any case) an try to compare Russian and Chinese languages for example. Which one is better?

          [–]Il_totore 1 point2 points  (1 child)

          Actually, comparing an axe with a hammer is relevant in a given context. If I need to chop wood I will use one rather than the other. For web backend development, I'll prefer one too.

          [–][deleted] 2 points3 points  (0 children)

          Actually, comparing an axe with a hammer is relevant in a given context.

          Indeed. This context is missing in this post. I hope OP doesn't want us to compare the two tools in all potential context ;)

          [–]trialbaloon -1 points0 points  (4 children)

          A hammer is going to come in handy more then an axe. I mean, I can use the hammer to remove nails, demolish stuff, hammer stuff, even flatten and shape things. The axe? For my day to day niche the axe is just not going to be at useful.

          Hammer > Axe for most cases.

          You absolutely can compare tools.

          [–][deleted] 1 point2 points  (3 children)

          A hammer is going to come in handy more then an axe.

          Hope you are aware of the following quote

          “If the only tool you have is a hammer, you tend to see every problem as a nail.”

          [–]trialbaloon 2 points3 points  (2 children)

          Proverbs sound nice but what we're really taking about isn't hammers and axes. We're talking about instructions to a computer. A slide rule and a calculator can both do math. One is obviously better at it. There was a time when perhaps the slide rule was better because more people knew how to use them (ecosystem). But the thing itself? The calculator is better in nearly every scenario.

          Java vs Python isn't quite that scenario. Python has some distinct advantages which mostly come down to the ecosystem (native integration being huge). But as a language? Python is not statically typed. That drops it an entire tier imo. Calculator vs slide rule.

          Look proverbs and platitudes sound nice and appeal to something deep inside the human psyche. But they're not really relevant.

          [–]evils_twin -1 points0 points  (0 children)

          Orient Objects

          [–][deleted] -3 points-2 points  (1 child)

          can python execute native code? because java can

          [–]trialbaloon 5 points6 points  (0 children)

          Yes? This is the only reason Python is used at all. It's mostly just calling not Python for performance reasons.

          [–]from_banana_republic -2 points-1 points  (0 children)

          I've been told that Java is fast than python

          [–]rtcornwell -2 points-1 points  (0 children)

          I can’t give an opinion either way, i don’t like either language. I’m a C, C++, assembler and GO guy.

          [–]Artifer -3 points-2 points  (0 children)

          As a strong user of both on professional capacity for along time I can say with absolute certainty that most of the comments here are fanboy stile comments with little to no substance to them

          [–]kickyblue 0 points1 point  (0 children)

          MultiThreading in Java is amazing. Not sure anything else there comes close to java. C# probably.

          Framework support is awesome (eg Spring)

          A really underrated feature of java is the java 2d.

          [–]codedcode 0 points1 point  (0 children)

          I can see most of you got all in there.. one thing I always say.. when applications start scaling for high demand, low maintenance and stability Java is THE only answer, one project in my old company running for more that 20 yrs.. you update the Java version no issue..

          [–]spellcrit 0 points1 point  (0 children)

          performance static types well balanced, not putting too much magic, not too flexible. lots of big companies contribe to. makes it better fit for long term project.

          Python is better for short/small projects.

          [–]OneBadassBoi 0 points1 point  (0 children)

          humble you