Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

31–40 of 718 posts

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

#31
post #4

"the second best language for any job"

There are many jobs where the .Net/Java/Go triad would be in the top 3. I lump them together as typed languages that are mainstream, performant, have a GC and a featured library.

I'm at a java shop. All customer facing apps are in java. Our tools and glue code is mostly in python. Similar for data processing workflows

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

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

I had honestly not considered that the author might have been talking about the visual aesthetic of the dunder methods themselves. Honestly that has me a bit stumped; all I can say is that if you don't like underscores, don't pick python.

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

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

Probably the system of giving special meaning to what are otherwise ordinary identifiers. __ isn't a reserved keyword in Python or anything. But there's a set of conventions you're supposed to follow when naming methods and attributes, and they're visibly artificial. It would be cleaner to make the features that are a special part of the language definition also a special part of the language syntax instead of runnin…

I'm not sure how "operator+" is supposed to be appreciably different from "__add__".

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

#34

I like Python for the language, and for a lot of jobs the threading model limitations do not matter. Its a great language to get stuff done. I find the package management story challenging but I will try uv next time!

If you haven't already you should check out uv: https://github.com/astral-sh/uv

It solves a lot of the package management headaches for me.

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

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

You don't call __init__ directly so the ugliness is limited to the definition which seems fairly minimal to me. It seems to be a naming convention for methods that are not invoked by name anywhere and that's at least informative when you're reading the class definition.

IMO this is less horrendous than e.g. go's insistence that exported functions are indicated by a capital letter - that really affects code using the module not just the definition.

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

#36
post #3

Earlier quoted context omitted.

I dont think python is pre-installed on macOS now. (uv has replaced it for me) Edit: Unlike older versions of macOS that came with Python 2.7 pre-installed, newer macOS versions (Catalina and later) no longer include Python pre-installed.

macOS dropped PHP recently too—doing a wonderful job of losing all that developer share that Apple was slowly building up.

I much prefer installing it myself, with the required version for my project and at a known and common location.

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

#37
post #31

Earlier quoted context omitted.

There are many jobs where the .Net/Java/Go triad would be in the top 3. I lump them together as typed languages that are mainstream, performant, have a GC and a featured library.

I'm at a java shop. All customer facing apps are in java. Our tools and glue code is mostly in python. Similar for data processing workflows

Yes that might demonstrate the point. Would Python be your second choice for the customer facing apps?

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

#38
post #2

> the Python interpreter is natively integrated in all Unix distros It's included in the default install of most desktop/server Linux distros (with plenty of exceptions), but I don't believe any of the BSDs ship it in their base system. IIRC macOS used to have python 2 in its default install, but I vaguely recall that being deprecated and removed at some point. My only Mac is on the other side of the country at the m…

Python 2 was removed in Monterey 12.3, which was incredibly stupid and disruptive as it caught everyone by surprise. We all knew Apple said they would remove it, but everyone was expecting them to be sensible and do it on a new major OS release, like they did with PHP, not mid-cycle.

https://developer.apple.com/documentation/macos-release-note...

I wonder if that kerfuffle is why they ended up not removing Ruby and Perl yet, despite the same promise. macOS’ Ruby is around 2.6. Perl I somehow doubt they’ll get to, as it’s such an important part of Unix admin I bet they themselves use it somewhere.

There is still a /usr/bin/python3 which is a shim. When you call it, if you don’t have the Xcode Developer Tools you’ll be asked to install them (it’s a non-scary GUI dialog which takes two clicks) and then you’re set. That is also a few versions behind the cutting edge, but it does get updated sometimes.

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

#39
post #3

Earlier quoted context omitted.

I dont think python is pre-installed on macOS now. (uv has replaced it for me) Edit: Unlike older versions of macOS that came with Python 2.7 pre-installed, newer macOS versions (Catalina and later) no longer include Python pre-installed.

macOS dropped PHP recently too—doing a wonderful job of losing all that developer share that Apple was slowly building up.

I think it’s better for developers to not have conflicting system distributions.

Though for a while there having built in interpreters was great for kids and learners.

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

#40
post #11
post #8

Python as a language is nice. Python's version and package management is nothing short of a nightmare.

Python's package management is OK. The main culprit is .so libraries Think JNI or cgo management.

Yes, I've never really understood the complaint about python packaging - building native code is not something that is ever easy to guarantee across multiple distributions and operating systems.

Those native packages can be in any language and require any odd combination of tools to build. Who has truly solved that problem?

Post reply on HN