Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

571–580 of 718 posts

Re: I'm switching to Python and actually liking it

#571

Earlier quoted context omitted.

I was talking about pip, not venv. I don't use venv either, not because I think it's a bad idea but because I can't be bothered. Stuff does end up conflicting unless I use Docker (lol) or uv.

If you use uv you are using virtual environments . You're merely being shielded from a few minutes worth of education about how they work ( https://chriswarrick.com/blog/2018/09/04/python-virtual-envi... ).

For some reason copying a venv directory causes problems with internal links. Fun all around.

Re: I'm switching to Python and actually liking it

#572

Earlier quoted context omitted.

Poetry has been decent for years. uv is new but great and will likely continue to be.

uv is soooo much faster than Poetry, especially for dependency resolution.

Did conda ever get faster?

Re: I'm switching to Python and actually liking it

#573
post #389

Earlier quoted context omitted.

You should always use virtual envs. They're a single directory, how are they an abyss? Pip now complains if you try to install a package system wide.

> You should always use virtual envs. If you're not using dependencies, and are writing 3.x code, there's very little justification.

Not using dependencies is rather niche. Most people come to Python because they want to use pre-existing libraries.

Re: I'm switching to Python and actually liking it

#574
post #141

> Not only because the syntax is more human-friendly, but also because the Python interpreter is natively integrated in all Unix distros That's kind of very optimistic evaluation - literally anything beyond "import json" will likely lead you into the abyss of virtual envs. Running something created with say Python 3.13.x on Ubuntu 22.04 or even 24.04 (LTSs) / Rocky 9 and the whole can of worms opened. things like vir…

I have a silly theory that I only half joke about that docker/containers wouldn't've ever taken off as fast as it did if it didn't solve the horrible python dependency hell so well. You know something is bad when fancy chrooting is the only ergonomic way of shipping something that works. My first taste of Python was as a sysadmin, back in 2012 or so, installing a service written in Python on a server. The dependency…

Basically in the world of C static vs. dynamic linking. A trade-off as old as programming.

Re: I'm switching to Python and actually liking it

#575

> Not only because the syntax is more human-friendly, but also because the Python interpreter is natively integrated in all Unix distros That's kind of very optimistic evaluation - literally anything beyond "import json" will likely lead you into the abyss of virtual envs. Running something created with say Python 3.13.x on Ubuntu 22.04 or even 24.04 (LTSs) / Rocky 9 and the whole can of worms opened. things like vir…

I agree that the built-in Python is typically not suitable for development, especially if you're planning to distribute your code and/or care about the versions of its dependencies. (And especially on Debian and its derivatives, in my experience; they even remove parts of the standard library , like Tkinter [0].) I disagree that virtual environments represent an "abyss". It takes very little effort to learn how they…

Many of the people I coached after they asked for help would have been absolutely flabbergasted by these suggestions.

Activating a venv was at least sething they could relate to.

Re: I'm switching to Python and actually liking it

#576

Earlier quoted context omitted.

> Much prefer Perl, I can actually get things done quickly Python lets you just nest data structures without having to twist your brain. You want a tuple in a list in a dictionary value: you just write it down and can access it with a unified notation. Bam. No reference madness and thinking about contexts. It's a big part of what I typically need to get things done quickly and understand how I did it 5 years later. T…

That's what got me off Perl. I loved it and was skeptical about Python, but one time after trying it for a week or so, I wondered what it would look like to pass a dict of lists of dicts into a function, then reference items inside it. My first try worked: I made a dict, with a list inside it, and a dict inside that list, and passed it as an argument without any sigils or reference decorators or anything. That was ab…

That is a surprisingly succinct take. That may actually have affected the demise of perl, apart from perl's breaking changes.

Powershell is also horribly offended by trying to nest arrays. As is bash.

Re: I'm switching to Python and actually liking it

#577

Maybe I'm the only one that finds Python simultaneously verbose and lacking? Either you need 500 dependencies to do something in a simple way, or you need dozens (if not hundreds) of lines to do trivial things. I avoid writing Python because there's so much bullshit to add. Much prefer Perl, I can actually get things done quickly. Python feels like programming for the sake of programming.

Python is a language that the standard lib is big enough that you don't need dependencies

Technically, C or assembly also fulfill this "requirement".

There seems to very few smart people who agree with this in practice, however.

Re: I'm switching to Python and actually liking it

#578
post #476

Maybe I'm the only one that finds Python simultaneously verbose and lacking? Either you need 500 dependencies to do something in a simple way, or you need dozens (if not hundreds) of lines to do trivial things. I avoid writing Python because there's so much bullshit to add. Much prefer Perl, I can actually get things done quickly. Python feels like programming for the sake of programming.

Have you met Java?

"Only in my web browser."

Those were the days…

Re: I'm switching to Python and actually liking it

#579
post #479

For me, python is the closest thing to writing pseudocode that functions. Every time I have the instinct to gloss over a thing when writing it down (because it feels obvious in my head), it turns out that python has an intuitive abstraction for it. Coming from a mathy background I found it incredibly satisfying, although I’ve come around to other languages since.

As a mathy person myself, I find the OOP leaning difficult to think about. Better equational reasoning, better lambdas, fewer side effects to worry about, avoiding mutation so that I can define something and still know what it is later during runtime, those are what help me think clearly. To me OOP is about the furthest paradigm from math that I’ve used.

OOP, especially the modern take, feels pretty far from just about anything.

Inheritence should have stayed esoteric. Composition is closer to reality.

Relations and functions and values are way closer to applications than OOP seems to be.

Re: I'm switching to Python and actually liking it

#580
post #546

If you use Make as a task runner like in the article, please make sure that you're also declaring your tasks as .PHONY targets: https://www.gnu.org/software/make/manual/html_node/Phony-Tar... Otherwise, the existence of a file or folder with the same name as your task ("test", for example) will stop that task from being run, which might be very annoying if you're using the Makefile as part of a script or CI or someth…

Oh, is that the actual reason it’s for?

IIRC the info pages just say that it is for targets that lack a file. This is way easier to remember.

Post reply on HN