Live data from Hacker News

Breaking up with Python

cedwards.xyz

11–20 of 179 posts

Re: Breaking up with Python

#11

I don't fully agree with these arguments, but they all have some validity. I really felt his point on the documentation - it's great that it's reference-complete if that's what you're looking for, but it's maddening if you are coming to something to find out what it does.

I often find myself typing

  python3
  import some_module
  dir(some_module)
rather than trying to find functionality on the docs sites anymore

Re: Breaking up with Python

#12
I agree with some of the sentiment here, but at the end of the day i’m not sure i’d be able to make a clean cut like OP suggests.

Python is used in so many places that’s it’s part of the lingua franca of programming. I’ve worked at multiple ruby shops over the last few years and pythons still been there in force for data applications.

I much prefer other languages (Ruby, Kotlin), but at the end of the day i need to be comfortable with the language that will be spoken for years to come.

Re: Breaking up with Python

#13
I've been recommending Python to the occasional aspirational young programmer. Is it already passé? What would you recommend instead for a starter language? Looking for beginner-friendliness, widespread use, and longevity.

edit: to be clear, I hope this won't devolve into a language flamewar. I'm sincerely interested in other devs' opinions, and hoping that either Python is still a good recommendation (which seems to be the consensus so far) or that there's a better alternative.

Re: Breaking up with Python

#14
The article mentions using JavaScript in place of Python. I use JavaScript a lot for browser stuff but can JavaScript be used for the random command-line scripts that I implement in Python? (Genuine question, not rhetorical.)

Re: Breaking up with Python

#15
post #4

I have just started getting into python as I'm experimenting with pytorch and after a lot of googling I'm still trying to figure out how to use conda properly. Could anyone point me to the best way to manage python environments and packages?

I don't think there is a "best" way, in my biased opinion package management for Python is terrible. It works for trivial cases but if you do anything serious it will get unmanageable fast.

Everyone will tell you of the "best" (i.e. their favorite) way to handle packages and dependencies. Usually mixed with some sandbox framework. Everything will be broken in some way: nonstandard, convoluted, too slow, cannot handle corner cases, or just way too difficult to understand. Even those labeled "for humans". Everyone will agree the situation is a mess "except for this one way that works": never trust that way, it doesn't really work past trivial cases.

Of course this is just my experience. But I feel after years of battling with Python and trying different things, I've earned the right to say this.

Re: Breaking up with Python

#16
I'm getting stuck into Go at the moment and thoroughly enjoying it, but can it really fill the same niche as Python as the article suggests? (Sincere question.) Doesn't the absence of an out-of-the-box REPL hinder quick scripting? As I say, I'm new to Go so would love to hear about people's experience using it in this context.

Re: Breaking up with Python

#17

I've been recommending Python to the occasional aspirational young programmer. Is it already passé? What would you recommend instead for a starter language? Looking for beginner-friendliness, widespread use, and longevity. edit: to be clear, I hope this won't devolve into a language flamewar. I'm sincerely interested in other devs' opinions, and hoping that either Python is still a good recommendation (which seems to…

No, it isn't passe, this developer just has some personal gripes with it that can range from understandable to "you'd complain if we did it any other way" with regard to their question about why type annotations were implemented the way they were.

Re: Breaking up with Python

#18
> Python’s documentation sucks

I can't agree with this. I have always had a very good experience with python documentation. One can use the built-in "help" function which works seamlessly with the docstring feature of the language. The complaint in the blog post seems to refer to the UI of the website missing a table of contents for functions. Yeah sure they could add that but I don't see it as a big point.

> Python’s package management sucks

Hmm, it has some weaknesses but I wouldn't really say it sucks. Going deeper ->

> Every project seems to use a different tool and it’s a massive headache. Off the top of my head there’s ...

Don't all of these use pip under the hood? I personally use the lower-level pip and virtualenv tools, but some others enjoy the convenience of poetry. That's a bit of personal preference. It's a bit more akin to an IDE choice than a feature of the language. None of conda, poetry, etc. are core Python features.

> Python’s standard library sucks

I have to disagree again, I think it is pretty well designed and minimal on purpose. The community additions of numpy, etc. are by design not part of the core language to reduce bloat.

> Python is slow

OK sure, it is slower than compiled languages like C++, that is a concession we make when opting for the ease of readability, writability, usability, etc.

> Python is huge, the python:3.9-slim Docker image is 118MB

Hmmm. 118MB isn't really that big anymore. The docker image would presumably be cached and reused in a deployment pipeline.

> Python syntax sucks.

This one I can't even understand the reasoning for. The python syntax is what people love about it. I personally dislike the walrus operator, f-strings, and some of the other newer features (did they add the switch statement yet?) but those are my only gripes. And they are more pet-peeves / personal preferences than complaints.

Re: Breaking up with Python

#19
> The python:3.9-slim Docker image is 118MB

Still smaller than most Go binaries.

Had to play with compiler flags to reduce trivy to a proper size (it was 300MB with default flags), and that was only the binary, without any containers.

And the dependency story is hardly any better than Python.

Re: Breaking up with Python

#20
I feel similarly. However, Python has

- reference counted objects with predictable scoped destruction. this keeps the maintenance of huge resources quite simple and memory usage steady

- operator overloading (infix, like +/*-)

I really wish other languages (like JS/Go) had this stuff.

Post reply on HN