Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

91–100 of 718 posts

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

#91
post #72

Earlier quoted context omitted.

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…

> You don't think the Python way is worse? Have you considered how much familiarity might shape your reaction to the two? Both are specific patterns with arbitrary restrictions which new learners have to internalize, and that’s a fairly advanced task most people won’t hit until they are familiar with the language syntax. Here’s a counter argument: the Python methods are normal method declarations whereas C++ develope…

> Have you considered how much familiarity might shape your reaction to the two?

It doesn't.

> Both are specific patterns with arbitrary restrictions which new learners have to internalize, and that’s a fairly advanced task most people won’t hit until they are familiar with the language syntax.

No, the Python methods are just ordinary methods with valid names. What 'arbitrary restrictions' are you referring to?

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

#92
post #73
post #45

From what I was told, Python was originally seen as a Swiss Army knife for sysadmins. It started gaining more traction when Canonical adopted it as the main language for Ubuntu 4.10 in 2004. Then, in 2005, Guido van Rossum was hired by Google to work on Google Cloud. That opened the door for wider adoption in academia, since Python had strong math libraries and integrated well with tools researchers were already usin…

Python's success is entirely due to entry-level programming courses. They all switched to Python, because you have to explain less. I don't think I heard about web servers in Python before 2012. I suppose a 2005 computer wouldn't be able to serve a Python backend smoothly. PHP's popularity isn't really from 2005-2006. It was popular at the end of the 90s, and it looks like JS as much as it looks like a potato.

> I suppose a 2005 computer wouldn't be able to serve a Python backend smoothly.

Python had web servers from 2000, including Jim Fulton's Zope (really a full framework for a content management system) and in 2002 Remi Delon's CherryPy.

Both were useful for their day, well supported by web hosting companies, and certainly very lightweight compared to commercial Java systems that typically needed beefy Sun Solaris servers.

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

#93
“I started to code more in Python around 6 months ago. Why? Because of AI, obviously. It’s clear (to me) that big money opportunities are all over AI these days. And guess what’s the de facto programming language for AI? Yep, that sneaky one.”

Why is that?

Why Python for AI?

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

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

[flagged]

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

#95
post #65

Python has done an impressive job over the years of making steady robust improvements. The typing and tooling has just gotten better and better. There are still plenty of problems though, imho async is still a much bigger pain than it should be (compared to other runtimes with a very nice experience like go or elixir, even dotnet has been less pain in my experience). Overall I like python, but it mainly boils down to…

I don't know what I am doing wrong but nothing written in Python has ever worked for me. I download the .py repo from from github or wherever and try to run it - errors. I try to install missing libraries pip this and that - errors. I battle fixing endless error with dependencies and when the .py finally runs - errors - wrong version of whatever library or wrong patch of this or that or the "production ready" .py doe…

That’s wild. The last time I had that experience with Python must have been more than 10 years ago. I’ll admit a decade ago you definitely did need to know way to many details about way too many tools from virtualenvs to setuotools to wheels, etc. to get things working from somebody else’s project, but imho, poetry and uv have really changed all that.

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

#97

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!

I resisted pipx, poetry, anaconda and probably some other things, as I didn't see the point over venv+pip. But uv is just so damn good, there's no going back.

Feel like pipx walked so uv could run, it popularized the idea of abstracting the environment management away from the user.

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

#98
post #72

Earlier quoted context omitted.

> You don't think the Python way is worse? Have you considered how much familiarity might shape your reaction to the two? Both are specific patterns with arbitrary restrictions which new learners have to internalize, and that’s a fairly advanced task most people won’t hit until they are familiar with the language syntax. Here’s a counter argument: the Python methods are normal method declarations whereas C++ develope…

> Have you considered how much familiarity might shape your reaction to the two? It doesn't. > Both are specific patterns with arbitrary restrictions which new learners have to internalize, and that’s a fairly advanced task most people won’t hit until they are familiar with the language syntax. No, the Python methods are just ordinary methods with valid names. What 'arbitrary restrictions' are you referring to?

The arbitrary restriction is that you have to just learn a specific pattern and follow it. I can’t have my Python class use “addition” if I hate underscores or my C++ code use “mathematical_division” if I’m horribly pedantic. In both cases, it’s just a particular design decision by the language developers I have to learn, and in both cases I won’t think much of it after the initial acclimation.

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

#99
post #81

Earlier quoted context omitted.

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

One is a sensible choice a human might pick. The other is not.

So who were the non-humans who picked the one you don’t like?

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

#100
post #59
post #25

Earlier quoted context omitted.

> Ruby developer indoctrinated against Python Ruby devs think about code differently. Like Perl, they embrace TIMTOWTDI. https://perl.fandom.com/wiki/TIMTOWTDI Also, there's a pride in writing elegant code as opposed to following "Pythonic" conventions. Excellence is not conformity. I use Python a lot more often now because it's seen as simpler and more approachable and easier to force compliance. I miss Ruby.

IMO "pythonic" is mostly about using the features the language has rather than trying to treat it as if it was Java or C++. Having said that, in reviews you do get lazy comments like "not pythonic" or "not best practises" which often boil down to the reviewer just not liking something and being too much of an *** to say why. This is supposed to be a total shutdown that you cannot argue with and it's the kind of thing…

I love this sentiment:

> There should be one-- and preferably only one --obvious way to do it.

But I often don't think the Pythonic way is a very good way to do it. And this leaves you a bit stuck!

Post reply on HN