Live data from Hacker News

Drawbacks of Python

quora.com

21–30 of 117 posts

Re: Drawbacks of Python

#21

Earlier quoted context omitted.

While the sentence is a bit weird, along the lines of "That word is made up." "All words are made up." strings ARE potentially harder to deal with in 2 than 3.

in my experience, most people want bytestrings most of the time, and the main effect of changing the str type has been to drive a lot of traffic to SO when they have encoding errors trying to deal with strings that used to "just work" in 2.7

I’m not quite sure about this. I think while python 3 has a tendency to blowup on IO, I still think that is preferable than more cryptic problems. Python 3 did seem to handicap working in bytes though, but I think that has improved in the last few versions with the path objects and str accessing Unicode text.

Re: Drawbacks of Python

#22
I like Python because of zen of python [1]. This fits my brain and had been very helpful. Indeed in 2004 I chose Django instead of Ruby On Rails just because explicit is better than implicit. Overall Python is productive and good. Yes it has some warts and corner case, but than its evident. Among programming language python has a humble community and very approachable. Also most programmer in Python will not hesitate to use low level language and interface with Python when necessary. It's not considered bad.

  >>>import this
"Beautiful is better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

Flat is better than nested.

Sparse is better than dense.

Readability counts.

Special cases aren't special enough to break the rules.

Although practicality beats purity.

Errors should never pass silently.

Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess.

There should be one-- and preferably only one --obvious way to do it.

Although that way may not be obvious at first unless you're Dutch.

Now is better than never.

Although never is often better than right now.

If the implementation is hard to explain, it's a bad idea.

If the implementation is easy to explain, it may be a good idea.

Namespaces are one honking great idea -- let's do more of those!"

[1] https://www.python.org/dev/peps/pep-0020/

Re: Drawbacks of Python

#23
post #2

"No language is perfect" is the perfect reply to asking about the drawbacks. The ability to get things done in a language is what allows someone to deliver VALUE to a client (or for their own projects). A workable solution now trumps a perfect solution that will take too long to implement.

JavaScript is a pretty bad language in my opinion, but does have the universal deployment problem solved a lot better than any other.

Re: Drawbacks of Python

#24
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).

how does conda solve this? Will conda fallback to pip if the conda repository doesn't contain one of your dependencies?

Re: Drawbacks of Python

#25

Earlier quoted context omitted.

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've found that the built-in tkinter lib is good enough for basic GUIs that you might use on a utility.

That's the one I've tried a bit before, but haven't spent enough time to be comfortable with it. The crux of it for this project is that if I were making a UI I'd like to move the data validation in to that (and add some more sanity checking) with visual indications if there's a bad row or something looks off. Currently it just it yells at you and terminates if there's invalid data.

So a UI rewrite would make it much friendlier to other users, but it'd be a time investment I can't justify over the "just don't give it bad data" strategy.

The inputs and outputs are all handled manually so reliability isn't a huge focus as long as someone can poke around for a bit and make it work. Only user is me for now, so ¯\_(ツ)_/¯

    # TODO: make it less shitty

Re: Drawbacks of Python

#26
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 believe fbs might have massaged some of your GUI packaging problems. I haven't used it myself, but a coworker who builds a Windows GUI application swears by it. From him, "It's the package manager python doesn't deserve"

https://build-system.fman.io/

Re: Drawbacks of Python

#27
post #23
post #2

"No language is perfect" is the perfect reply to asking about the drawbacks. The ability to get things done in a language is what allows someone to deliver VALUE to a client (or for their own projects). A workable solution now trumps a perfect solution that will take too long to implement.

JavaScript is a pretty bad language in my opinion, but does have the universal deployment problem solved a lot better than any other.

JavaScript is the perfect example of give hackers a bit and they'll take a damned terabyte.

Re: Drawbacks of Python

#28
post #17

Earlier quoted context omitted.

in my experience, most people want bytestrings most of the time, and the main effect of changing the str type has been to drive a lot of traffic to SO when they have encoding errors trying to deal with strings that used to "just work" in 2.7

The thing about "just works" in 2.7 is that it does ... until it doesn't, and when it doesn't, it's often way harder to resolve. If you're only using the original ASCII (ordinals 0-127), all is well, and the py3 distinction between strings and bytes seems to get in the way. But as soon as you have a single character in your input or data which is not ASCII, a lot of things stop working and it isn't even clear why, or…

Maybe you're right. Maybe there are applications where this really matters.

All I can say is that I have never once had that problem since I started using Python (circa version 2.4). It has always been fine. For example, when dealing with .csv files created with MS Excel, you get strange characters because Excel uses CP1252 encoding, not ASCII. They never tripped up my app in python 2.7. It happily passed them along. Even regular expressions worked. Python3 died repeatedly until I went through and forced everything to be bytestrings.

Re: Drawbacks of Python

#29
I have to deploy web applications written in Python on Windows... no uWSGI, no Gunicorn and no easy multiprocessing because no fork(). It's painful quite often and it makes me loathe the GIL, but I still enjoy writing Python code.

Re: Drawbacks of Python

#30
Dunno if Ruby locked my mind into a certain mode, but I've never felt good doing anything with python :( 2 different projects I tried participating with a lot of years in between, still felt the same. Granted, I can't say I've really studied it properly.
Post reply on HN