DEV Community

Discussion on: Why all this hate about Python?

Collapse
 
scottanderson42 profile image
scottanderson42

Bad programs can be written in any language; Python's flexibility means you need to be more disciplined than in a statically typed language like Java. I've worked on Java teams before that would be nightmares if they were using Python.

That said, if your team's testing, craft, and review discipline are solid, Python is just fine for projects large and small. Similarly, overall design and architecture outweigh a language's straight-line efficiency for most classes of projects.

I've been using Python as an actual language on actual projects for years without any nightmares.

"the mess that is pip" - I'd be interested in more details there. Java is no stranger to dependency hell either, particularly in the world of EE.

I do agree that the migration to Python 3 was completely mishandled. I think things are finally getting there (Django 2 refusing to run on 2.x is a huge step) but wow, what a way to drag things out.

Collapse
 
shacham6 profile image
Shacham6

You are correct. A lot of bad software is written in any language.

And yes - with great discipline, great software can be written with Python.
But why even try when there's no real benefit? The language is still very slow when compared to any compiled statically typed language.

I called pip a mess but I admit it was uncalled for. Pip is fine.
What I generally dislike is the way Python handles libraries in general - with them being global and all. It creates mess, with one project requiring 1 version of a library and another project another - what do you do?
The libraries are global, and it affects ALL of your projects at once.
Another problem is that should I create a Python project and want to release it on production, I need to NOT ONLY install Python, but pip with every dependency as well, at a global scope.
With Java - I can compile the my project to include the libraries I use. I need only the JRE on production, and I'm golden :D

For the very least - I despise Python on a project level. A lot of things can go horribly wrong, and a great level of discipline is required to make the most out of it.
I work at place where people use Python only because they needed to get things done QUICK.
They didn't have discipline.
And I'm the one that suffers all of their horrible, horrible choices.
So yeah, more often than not I'm more scarred fron the misuse of Python than anything else.

Thread Thread
 
evanoman profile image
Evan Oman

Java + Gradle (or any of the major build tools) = 😍😍😍😍😍

Thread Thread
 
scottanderson42 profile image
scottanderson42 • Edited

"But why even try when there's no real benefit? The language is still very slow when compared to any compiled statically typed language."

Because straight-line execution performance is, for most applications, far less important than architecture and team productivity. For a web site, caching, CDNs, and concurrent processing will take you much further than your language choice will (within reason: don't write your web site using DOS batch, please). Python is Fast Enough. And when it isn't, it's very good at calling your favorite compiled code for performance sensitive pieces.

Additionally, it can be far more productive than a language like straight Java.

"What I generally dislike is the way Python handles libraries in general - with them being global and all. It creates mess, with one project requiring 1 version of a library and another project another - what do you do?
The libraries are global, and it affects ALL of your projects at once."

You use virtualenv, as it is the tool that was created specifically to address project-specific libraries. Global libraries are a solved problem.

"Another problem is that should I create a Python project and want to release it on production, I need to NOT ONLY install Python, but pip with every dependency as well, at a global scope.
With Java - I can compile the my project to include the libraries I use. I need only the JRE on production, and I'm golden :D"

As above, no, you do not need to install these at global scope. In fact, you can run different versions of Python with different projects in the same scope as well. J2EE can have more of a problem with global system libraries (remember log4j vs. commons logging in Tomcat?) than does Python.

"For the very least - I despise Python on a project level. A lot of things can go horribly wrong, and a great level of discipline is required to make the most out of it."

Great discipline is required with every language to make the most out of it. Python is no different here.

"I work at place where people use Python only because they needed to get things done QUICK."

Yes, that is a very real benefit of Python.

"They didn't have discipline.
And I'm the one that suffers all of their horrible, horrible choices.
So yeah, more often than not I'm more scarred fron the misuse of Python than anything else."

This again is not a Python problem, it's a management and team problem.

Thread Thread
 
krudflinger profile image
Clay Kuppinger

Pyenv + pipx + pipenv for all projects.