Live data from Hacker News

Drawbacks of Python

quora.com

101–110 of 117 posts

Re: Drawbacks of Python

#102
post #66
post #6

I agree with the response that there are a few "gotchas" with python, like with any language! I have gotten caught up with a few type problems when dealing with sending raw binary data over serial and things like that - but luckily python has great unit testing frameworks to help with this. My main beef with python is that it is harder to deploy projects to other people, without them setting up a virtual environment…

I wish it had a better async story. We've had production outages that were difficult to debug because some third party library made a sync call deep in the call stack and starved the event loop. APM showed performance degradation in unrelated endpoints. Eventually health checks began failing and containers were killed, putting the load on other containers which inevitably fell over and so on. We've seen similar issue…

Trio is my favorite async library. It's simple and extremely powerful. https://trio.readthedocs.io

Re: Drawbacks of Python

#103
post #87

Earlier quoted context omitted.

I've lost approximately zero hours to indenting or formatting issues in Python or other languages. Unit tests usually do a good job of catching unexpected behavior quickly.

For some of those issues, you could type brackets instead of unit tests. Brackets are a lot less work.

for all of these same issues, using a decent editor and a linter saves approximately the same amount of work.

every time this discussion comes up, it's clear that people simply aren't willing to accept that this is a solvable problem, despite the many people who always come out of the woodwork to insist that we've solved it. Is it really that hard to accept that someone out there may have solved something you haven't?

Re: Drawbacks of Python

#104
I love python and it is my main language for almost everything.

However, yesterday I was playing with python’s async/await and I came to the conclusion that it is a bit... useless.

Not a big deal, because i can use other stuff to accomplish the same I was trying to do.

Or maybe I was doing it wrong.

Re: Drawbacks of Python

#105
post #6

I agree with the response that there are a few "gotchas" with python, like with any language! I have gotten caught up with a few type problems when dealing with sending raw binary data over serial and things like that - but luckily python has great unit testing frameworks to help with this. My main beef with python is that it is harder to deploy projects to other people, without them setting up a virtual environment…

> Also, it is hard to create GUI applications vs languages like C#

While this is a problem, for many projects, I have overcome this by including a local web-server, that accepts requests from 127.0.0.1 and serves a web app as a GUI.

It's not a perfect solution, but It worked for me in many projects.

Re: Drawbacks of Python

#106
post #6

I agree with the response that there are a few "gotchas" with python, like with any language! I have gotten caught up with a few type problems when dealing with sending raw binary data over serial and things like that - but luckily python has great unit testing frameworks to help with this. My main beef with python is that it is harder to deploy projects to other people, without them setting up a virtual environment…

I have the same two complaints. I’ve automated some large tasks at my job with Python, and avoided external dependencies because while I’m sure I could deal with it, nobody else here is a programmer and it don’t think it would go well if someone had to try and figure that out later. “Install python (3.6 or later), point script at the csv file” avoids that complexity. It’d be better if it were a self contained executa…

I used to be type of of developer who would always make executables and installers in years gone by. I find now in all cases I whip up what I want to do as a script and then embed it in Flask as a webapp. The only thing I don't do this is with compiler tools that I can bring in with cmake etc. If the app needs data I just add an upload button or have it point at S3. YMMV.

Re: Drawbacks of Python

#107
post #87

Earlier quoted context omitted.

For some of those issues, you could type brackets instead of unit tests. Brackets are a lot less work.

for all of these same issues, using a decent editor and a linter saves approximately the same amount of work. every time this discussion comes up, it's clear that people simply aren't willing to accept that this is a solvable problem, despite the many people who always come out of the woodwork to insist that we've solved it. Is it really that hard to accept that someone out there may have solved something you haven't…

As people have said in other comments, no static analysis can read your mind. You can have valid Python that contains logic errors due to indentation mistakes, and you can only catch it at runtime. Period.

That said, everything is a trade-off. Semantic whitespace has downsides, but if the upsides outweigh, then it's a great idea.

At this point, I have no idea what the upsides are, other than saving a few keystrokes (which truly is solvable with a good editor).

It's like removing the ending semicolon in JavaScript. Sure, it almost never causes a problem, but sometimes it does, so why do it?

Re: Drawbacks of Python

#108
Maybe I'm naive, but in my mind besides their ecosystems and superficial syntax differences there isn't that much functionally different between Python and Ruby, with the major to exception of blocks in Ruby.

In which case the decision between the two seems to be between a thing and a slightly better version of itself. I totally respect that many people see this differently and probably exactly opposite but to me it always feels really hard to justify using python for this reason.

Just for fairness sake I'm not trying to trash python. I think it's a great language.

Re: Drawbacks of Python

#109
Sorry but it just seemed odd I didn't see a mention for GIL (global interpreter lock).

Because of this mechanism that ensures concurrency safety Python does not support parallel execution of threads. I am wondering if the rest of the HN community finds it as a major disadvantage.

Re: Drawbacks of Python

#110
post #12
post #9

The main drawback of python for me, compared to NodeJS is the whole sharing projects onto different machines with virtualenv or whatever. package.json and node_modules just works by default in so much cleaner a way. You can use npm or yarn or just a zip of the node_modules to share the environment with a colleague or to deploy.

conda solves that for python at least as well as npm/yarn does. I don't understand while it is not in wider use (except for lack of PR).

If you want to add your own project to Conda, you need to use conda forge, because Anaconda itself is a curated distribution.

Maintaining a conda forge package has been, for us, a complete nightmare. If you depend on another conda-forge package you can have the issue that the library is configured to suit whoever first wrote the conda-forge package - i.e. by disabling parallelism or providing only shared/static libraries, and have that maintainer be completely unresponsive or unwilling to change it.

Post reply on HN