loading...

re: Python vs Java VIEW POST

FULL DISCUSSION
 

Java has such an enormous eco-system built around itself, it's hard to even compare it to any other language. It probably can do almost anything, setting aside the age-old topic of "if we can do it, should we?".

Pythons ecosystem on the other hand is rather small in comparison, but it got a nice niche in AI/Big Data it dominates handily.

To be honest, it's not the language java itself, that I love. It's what Maven and Gradle make out of it that really eases the process of developing with java. Once you get used to your build-tool of choice, it's just copy-pasting dependencies and bam, you get everything you may need, including the appropriate build plugins for your workload.

Fire up a simple build command and you get a nice deliverable artifact. How amazing is that?

While Java is heavily restricted by it's conventions, you get a lot out of it for free. Getting back to maven, for example. Add your pom.xml with the typical boilerplate stuff and you essentially get the whole build-chain for free.
Python doesn't have as many conventions, but that freedom costs you the effort of doing most things yourself.

Edit: I'll refrain from editing out my wrong statements, but absolutely recommend reading the answers to my comment that correct them!

 

JAVA's ecosystem is small compared to JavaScript you can't even compare both, JAVA is more niche (businesses), In JavaScript you can really do everything.

 

Java is niche? I disagree strongly. It might be (falsely so) considered legacy by some, but it is by no means niche.
Java is now, with microservices and containers, facing a huge demand and second wind once again.

I usually don't defend any language, because it's mostly flavour and opinions, but Java is definitely a language we can call full-stack.

Javascript may be much larger in it's userbase, but even so it's ecosystem is smaller.

With Java you get full fledged and battletested CI/CD (Jenkins), package and artifact Management (Nexus, artifactory), security scanning (NexusIQ, Sonar), observability (built into JVM), deployment Management (AppServers of different flavours) and much much more.

Everything managed by commonly accepted and well-defined Standards.

Thats not something you can get with Javascript as of now.

Libraries, of which Java has more than enough for every possible use-case, aren't everything I'm afraid.

I'm not denying Javascript it's deserved glory, far from it. The improvements it made over the last 10 years are astonishing!
But the tooling changes so rapidly and often, getting something as proven and tested as the Java World Counterparts will take a lot more time.

I would also like to add Quarkus. I am not very experienced but It looks really awesome to me. with graalVM and quarkus, we can now make native java executable and size of these executable are very small compared to JAR. It's performance will also be better since it is machine code instead of byte code. The startup time is also very fast, which is important for microservices in some cases.

Best of all, we can use same API's like JPA, CDI etc. so an experienced java developer can get easily started with quarkus.

Do check it out - quarkus.io/

Absolutely true.
In one of my clients projects we are using Quarkus and migrate quite a few webservices to it currently.
The performance and minimal overhead of the resulting native binaries is amazing.
It takes quite a bit of modification to the typical CI-Chain, but if you get it to run smoothly, the results are astonishing.

If you want, I could write up a little article about it here

yeah, I would love it.

It will be very helpful as there is relatively less material available on quarkus.

 

Can you do stuff with SIM cards in JavaScirpt? Highly doubt it. And such examples might trigger "niche" comment which basically is saying let's ignore elephant in the room and focus on mouse - which is web app development and that includes microservices and such.

Go check how big is Spring alone. It's not a framework it's quite a few frameworks which can make a platform. Check Apache Java stuff, like Apache Camel which is similar to Spring Integrations - still Java and still one of the go-to solutions for integrations none of which I've seen in JS and integrations are even out of "businesses niche" now. Almost all of us do it even for mid sized projects. Try to look at Red Hat stuff made for Java alone. Go browse through maven repository. Not even C# ecosystem (or .NET to be more correct) can compare to it in terms of size/quantity. And this is why people are not willing to leave JVM. It has so much things done you rather cry how hard they are to work with than to write it yourself in another platform.
It's plain simple, number of libraries, frameworks and such, regardless of their use case, are bigger for JVM mainly written in Java because it was the language before Scala, Groovy, Clojure, and such, and Kotlin lately.

Basically that "niche" your talking about is waaaaay bigger than your "non niche" which makes no sense for me to call it that word then.

You might call it new COBOL which indicates it will be forgotten by many at some point but live like a plague and poison anyone who touches legacy system that must work, but it doesn't change the fact that we still need something to catch up with it's size to be able to say "Java is dead" and make sense.

 

Pythons ecosystem on the other hand is rather small in comparison, but it got a nice niche in AI/Big Data it dominates handily.

I hear about this purported "niche" a lot, but in nearly a decade of Python coding, I've never observed it. Python has a fairly broad ecosystem when you factor in libraries (installable via pip or poetry in one line): it handles not only AI and data, but is excellent at GUI, networking, system interoperability, and just about anything you can throw at it. The only area Python really doesn't excel at is true multiprocessing, thanks to the Global Interpreter Lock (GIL), but there's work being done to resolve that too.

Python doesn't have as many conventions, but that freedom costs you the effort of doing most things yourself.

Uhm, this is most certainly not true. Python has a greater emphasis on convention and The One Obvious Way (as we put it) than most other languages, Java included. We have no fear of boilerplate — cargo cult programming, as Guido calls it — but we do avoid mindless boilerplate when we can (except, perhaps, in setup.py). Testing, packaging, deployment, all of these work well once you know where a couple of pieces fit, to the same degree as Java and Maven.

 

Interesting, I never really observed Python like that, though judging by your comments, it's absolutely certain you are far more knowledgeable with Python than I am.

With eco-system I meant more the tooling around the languages, like CI/CD, Security Scanning, Lifecycle-Management and the likes.
I would assume a big portion of that is probably not even necessary for Python. What would your take be on that?

So thank you for your input and correcting my wrong statements.
It seems I have to do more Research next time

  • CI/CD: There are a number of robust testing frameworks, including PyTest, Nose, and the newer Ward. Python also integrates beautifully into most CI/CD frameworks, especially given the relative ease of deploying a package. (On that note, many Python projects even automate publishing their package to the Python Package Index using GitHub Actions or the like.)

  • Security Scanning: Bandit is one prominent example, and I know there are others.

  • I don't know about Lifecycle-Management, as I haven't used it, but a casual glance through the Python Package Index, or PyPI, it looks like there are plenty of options.

It's a common myth that Python isn't suitable for large projects. In fact, there are a number of very large applications and libraries built entirely in Python. It has its flaws, but Python is often excellent for software architecture and deployment because it "just works" in most situations, and aims to be intuitive while staying out of your way.

Thank you for your take, you never stop learning!
I guess I'll spend this weekend on Python and taking a look at the tools you mentioned.

The last time I had any python on my screen was when I wrote custom ansible filters and a few shallow dips into Django, which confused the hell out of me.
It's about time for a refresher :)

 

It turned out that many java limitations are very useful in long run. For example, quite strict linking between class and it's file name and location allows to keep at least some level of order in project codebase. Once this restriction is removed (Kotlin) maintaining order became a sensible effort, since devs tend to make shortcuts.

 

I absolutely agree.

Though I am more focused on the conventions part that comes with Java, since that is probably the first thing a Newcomer encounters.

Most frameworks, especially in the EE Version are convention over configuration. Conventions are just that, they can be ignored.
Which you absolutely shouldn't, but hey, you could even use pointers and allocate memory yourself if you want, so theres that.

The conventions are, mostly, of intelligent design and as a bonus it saves you a lot of time you would otherwise spend on cumbersome configuration, by having sensible defaults.

CDI/JPA (especially compared to their initial/earlier versions) would be a great example of convention over configuration and how much is done in the background for you.

code of conduct - report abuse