Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

291–300 of 718 posts

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

#291
post #252

Earlier quoted context omitted.

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

If your style is doing a lot of functional programming, multi-line lambda is a very natural thing to do. Other times you want to use a variable or several variables without actually passing it around as an argument. It makes sense especially if you are already used to it in Java/C++/JavaScript/Go. Is it "better" than a named function? No, of course, they work mostly the same. But we are not talking about better or no…

This makes a lot of sense, I got to a similar conclusion in my other reply.

I always thought the appeal of functional programming was more about test-ability and concurrency, it never occurred to me that people actually preferred the syntax.

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

#292
post #53

Unpopular opinion: I think I’m going to wait for version 4 /jk. But honestly, I’ve been spoiled by modern languages like Rust, Go, and even TypeScript with modern tooling, strong typing, stability, and performance out of the box. Right now, I’m just interacting with LLMs, not building them. That said, I remember writing myself a note a few years ago to avoid Python projects. I had to clean up code from all over the c…

What makes TypeScript better than Python? I don't get it..

Much more capable and reliable type system, paired with comparatively sane package management. This is getting better in the Python world (thank you Astral), but it's still not anywhere near the same.

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

#293

Earlier quoted context omitted.

There are massive numbers of devs who would never even think of trying to code in a dynamically-typed language, even though the big players all have gradual typing. They don't know what they're missing.

I have no problem with dynamically-typed languages, my main problem with Python is the significant whitespace. I really do not like it. I can deal with everything else in Python, or any other programming language, but significant whitespace is what kills it for me.

Even after writing tons of python the whitespace is still the reason why I never reach for it by default.

Today the IDEs got much better, but I still can’t see the significant whitespace as anything than downside. With brackets I can indent, but also have automatic indenting succeed every single time.

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

#294
post #287

> I would like to have a tool that generates the project structure for me, but I haven’t found one that fits me yet. I recommend cookiecutter for this. I have a few templates I've built with that which I use frequently: python-lib: https://github.com/simonw/python-lib click-app: https://github.com/simonw/click-app datasette-plugin: https://github.com/simonw/datasette-plugin llm-plugin: https://github.com/simonw/llm-p…

Copier is the new hotness for this

https://copier.readthedocs.io/en/stable/

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

#295

Earlier quoted context omitted.

> It's like the bright orange garments that hunters wear, the ugliness is sort of the point. Ugliness is not the point of hi-vis vests lol, the point is to not get shot by other hunters.

...by being as shockingly contrasting with their environment as possible. Maybe your aesthetics differ, but I find it quite ugly. If it wasn't, it wouldn't grab my attention so well. Wearing something shockingly ugly is a great way to not be mistaken for a deer. By contrast, I find a well camouflaged deer quite beautiful--once I notice it at all. The beauty comes from the way that it is so clearly a thing of its surr…

> Wearing something shockingly ugly is a great way to not be mistaken for a deer.

Sure... yes the bright orange is ugly, but it's not the ugliness that prevents you from getting shot, it's the bright unnatural color. Other hunters aren't thinking "oh that's really ugly, it must not be something I can shoot" they're thinking "bright orange means person, I should not fire my rifle in that direction".

> If it wasn't, it wouldn't grab my attention so well.

Are you saying that if you thought the bright orange was pretty it wouldn't occur to you not to fire your gun in its direction?

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

#296

Earlier quoted context omitted.

When it got big enough that companies were forcing people to learn it. People automatically hate things they didn't choose themselves. Plus there has been a rising sentiment against dynamic typing by masochists over the last decade or so.

> by masochists Hey! The masochism pays dividends. I can't do anything with duck typing that I can't also do with `dyn Trait` abuse :)

HA! Alright Fair enough :-)

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

#297
post #285

Earlier quoted context omitted.

If I were to try again I'd go with uv, it seems way way better

I have been sticking with poetry for a while, now. What would make me want/need to move to uv?

yeah Poetry is fine

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

#298
post #276
post #254

Earlier quoted context omitted.

link to talk please if recorded. I think one comment I saw here on HN that Java is better if written in Pythonic way. I agree completely with that stance. but yeah within Java you've 'merchants of complexity' people who wanna do things in the most abstract way rather than the simple way. btw Java can be as simple as Go.

I don't think that the talk has been released on public YouTube yet (and they made it clear to not share the unlisted links publicly), but here is the posting: [url-redacted] And the slides are available here: [url-redacted] I'm afraid that my humor isn't really reflected in the slides, but imagine everything here is said kind of snarkily. Java can be mostly as nice as Go, the BlockingQueues and Virtual Threads can g…

Github link is 404

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

#299
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…

I've been doing Python professionally for a while (~10-ish years in backend web dev and file processing), and while I don't like how exactly the author described dunder methods as "legacy", it's still not a language facility I reach out to often because, well, it's sort of odd coming from a C# background. The author has blog posts about Java, which isn't that different from C#, so maybe that's the reason.

Maybe as I grow to think of the "big picture" architecture-wise with my code, I will start incorporating dunders, but until then...

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

#300
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

Fewer characters than “initialize” or “constructor”, clearly marked as being “not a normal method”. Python is better here.
Post reply on HN