Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

221–230 of 718 posts

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

#221

When did Python go out of fashion? This is the second article I've seen talking about it as if it's some kind abomination. I get that it's not the shiny new thing, but I don't understand people hating on it. Is this just junior devs who never learned it, or is there some new language out that I missed? (And please don't tell me Javascript....)

I have had a somewhat unearned distaste for Python for the last decade or so. I mostly just don’t like some of the design decisions it made. I don’t like that lambdas can’t span multiple lines, I don’t like how slow loops are, I don’t like some functions seem to mutate lists and others don’t, and I am sure that there are other things I missed. But it really comes down to the fact that my career hasn’t used it much. I…

why would you want a lambda to span multiple lines? How would that be any better than a function?

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

#222
post #80

Just a small note on the code in the linked script: API_KEY = os.environ.get("YOUTUBE_API_KEY") CHANNEL_ID = os.environ.get("YOUTUBE_CHANNEL_ID") if not API_KEY or not CHANNEL_ID: print("Missing YOUTUBE_API_KEY or YOUTUBE_CHANNEL_ID.") exit(1) Presenting the user with "Missing X OR Y" when there's no reason that OR has to be there massively frustrates the user for the near zero benefit of having one fewer if statemen…

Even better, check all the conditions and report all the errors. Don't make me add the first variable, run it again and get another error.

Sometimes that's inevitable, bit noisy of the time it isn't.

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

#223

When did Python go out of fashion? This is the second article I've seen talking about it as if it's some kind abomination. I get that it's not the shiny new thing, but I don't understand people hating on it. Is this just junior devs who never learned it, or is there some new language out that I missed? (And please don't tell me Javascript....)

Apparently the author used to be a Java person. I have this feeling - or prejudice - that people still in the Java World are a bit out of tune with the tech industry, working on huge legacy projects on big retail or US banking. These people tend to be conservative and resistant to change, so maybe that's where these types of articles are coming from.

I've always felt X was far superior to Y, and don't get me started on Z or W.

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

#224

Earlier quoted context omitted.

I have had a somewhat unearned distaste for Python for the last decade or so. I mostly just don’t like some of the design decisions it made. I don’t like that lambdas can’t span multiple lines, I don’t like how slow loops are, I don’t like some functions seem to mutate lists and others don’t, and I am sure that there are other things I missed. But it really comes down to the fact that my career hasn’t used it much. I…

why would you want a lambda to span multiple lines? How would that be any better than a function?

Because sometimes I want to have logic that spans multiple lines and I don't want to assign it a name. An easy example might be something with a `map` or a filter. For example, in JavaScript

    [1,2,3,4].filter(x => {
        let z = x * 2;
        let y = x * 3; 
        let a = x / 2; 
        return (z + x * a) % 27 == 2;
    });
Obviously I know I could name this function and feed it in, but for one-off logic like this I feel a lambda is descriptive enough and I like that it can be done in-place.

You're free to disagree, but I think there's a reason that most languages do allow multi-line lambdas now, even Java.

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

#225

Earlier quoted context omitted.

Using a nix devshell has worked out well for scripts for me so far. I haven't figured out what that workflow is like for larger projects though. I'm not interested in learning Uv

As a nix user, you hardly need to know uv, but you might later need to know how to work together with non-nix-users who use uv. It's easy. There will be a file: uv.lock You can use uv2nix to get a single nix package for all the project's python dependencies, which you can then add to your devshell like anything else you find in nixpkgs (e.g. right alongside uv itself). It ends up being two or three lines of code to a…

Didn't I say I wasn't interested?

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

#226
post #177

When did Python go out of fashion? This is the second article I've seen talking about it as if it's some kind abomination. I get that it's not the shiny new thing, but I don't understand people hating on it. Is this just junior devs who never learned it, or is there some new language out that I missed? (And please don't tell me Javascript....)

I coded happily in python for many years and fell out of love with it. It doesn’t ship with a first party package manager so you got the community trying to fill this gap. Use any other language with good tooling like golang or rust and it is a breath of fresh air. Python used as an actual PL is a footgun because it’s dynamic scripted. (Don’t tell me about using tools X, Y, Z, mypy, …) You essentially become the comp…

> A programming language that’s only good for What a bunch of crap. It's so trivial to show very popular and useful programs written in Python that far exceed this number I'm not even going to do the work.

What a lazy criticism.

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

#227

Earlier quoted context omitted.

Using a nix devshell has worked out well for scripts for me so far. I haven't figured out what that workflow is like for larger projects though. I'm not interested in learning Uv

There's nothing to learn. Get Claude code to install uv into your devshell and cut over your requirements. 5 minutes.

AI? :vomit_emoji:

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

#228
post #47

Earlier quoted context omitted.

This hasn't really been true for a while now. `uv` has radically improved the experience.

For the last 20 years that has been the mantra. Some X "solves" all the problems. Except it doesn't. It just creates another X that is popular for a while, and doesn't somehow retroactively "fix" all the chaotic projects that are a nightmare to install and upgrade. Yes, I understand people like Python. Yes, I understand the LLM bros love it. But in a real production environment, for real applications, you still want…

> But in a real production environment, for real applications, you still want to avoid it because it isn't particularly easy to create robust systems for industrial use.

This is silly and seems to discount the massive Python codebases found in "real production environment"s throughout the tech industry and beyond, some of which are singlehandedly the codebases behind $1B+ ventures and, I'd wager, many of which are "robust" and fit for "industrial use" without babysitting just because they're Python.

(I get not liking a given language or its ecosystem, but I suspect I could rewrite the same reply for just about any of the top 10-ish most commonly used languages today.)

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

#230
post #5

> Python has done a good job of hiding its legacy ugliness (such as __init__, __new__, and similar aberrations), swettening its syntax to accomodate developers with good taste. What exactly is the problem with __init__ or __new__? @dataclass is very nice syntactic sugar, but are we arguing here that having access to initializer/allocator/constructor dunder methods is "legacy ugliness"? This is the core of pythonic bu…

Bizarre is that you don’t consider it ugly. Kotlin: constructor is either part of class definition or keyword constructor. Ruby: initialize JS: constructor Python: ______new______, _______init_______ Literally this meme: https://knowyourmeme.com/memes/three-headed-dragon

As if other language don't have their warts.. Ruby and Javascript for example have hideous syntax, comparing this with some special naming is quite bizarre.

But who cares? It's syntax, it has its purpose.

Post reply on HN