Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

121–130 of 718 posts

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

#121
post #79
post #71

Earlier quoted context omitted.

Can you elaborate bit what is the problem here? Is it shape of the characters or something else?

Amazing. If you need to ask this question I am guessing you have spent too long with Python . No other language uses this underscore madness for special methods or otherwise. Because it’s just , I don’t know a more appropriate word for it , stupid.

Oh yes they do: https://www.php.net/manual/en/language.oop5.magic.php

The programming languages world is broad/varied enough that any statement like "no other language does this!" is almost certainly wrong (outside of esoteric languages, which python and php most certainly are not)

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

#122

Earlier quoted context omitted.

[flagged]

I hope you’ll be stuck debugging “error happened” without stuck trace and “x, y or z” are missing forever.

My forever favourite error message is iverilog encountering a problem and simply printing: I give up

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

#123

Earlier quoted context omitted.

I like that magic method names generally all follow the same form so it's obvious that they are magic methods and not intended to be part of the public API. Whether that form uses double underscores or something else doesn't really matter to me as they are not being called directly.

> it's obvious that they are magic methods and not intended to be part of the public API Is there an alternative API? No. This is public API regardless of anyone's intentions. Though "it's weird" is really not a very strong argument against it.

Public API refers to the user of the class, not the implementer. You never call __init__ directly. __new__ allows modifying object creation itself for the implementer, but the user of the class will never call it.

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

#124
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.

This is entirely backward. They all started switching when python was already immensely popular after the popularity boosts given by sysadmin, django and numerical/datascience users.

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

#125
post #8

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

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.

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

#126
post #122

Earlier quoted context omitted.

I hope you’ll be stuck debugging “error happened” without stuck trace and “x, y or z” are missing forever.

My forever favourite error message is iverilog encountering a problem and simply printing: I give up

>> long running batch job

'process exited with status 1'

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

#127
post #73

Earlier quoted context omitted.

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.

With python you can just go: 'print "hello, world!"' and that's a full-ass program You run it by saying `python hello.py`. Compare that to the amount of crap you need(ed) with 2005 Java just to have something running. The shittiness of ActivePython and generally getting python to run on Windows were a bit of a hurdle, but still it was easier than the competition

I mean, it isn't like you couldn't get similarly terse scripts in other languages. Common LISP, as an easy example people love to beat up on.

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

#128
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 argue that Python's success was almost entirely due to it not adopting any best practices on dependency management and being installed by default on systems.

Being default installed was almost certainly the larger factor. As evidenced by how much pain it caused people when they started using dependencies that were not stable. They had to add specific support for it to not let you pip install things to the system install.

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

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

Why not add a boolean flag and use a single exit(1) at the end? That way the user can see all the environment variables that have not been set.

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

#130
post #73

Earlier quoted context omitted.

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.

This is entirely backward. They all started switching when python was already immensely popular after the popularity boosts given by sysadmin, django and numerical/datascience users.

This is what I have seen as well. When Python became ubiquitous in the industry, they started teaching it in the colleges.

I come from a core science background. I studied Physics. And it was like this in my institute: FORTRAN -> A lot of C, small amount of FORTRAN -> C -> Python. I was taught C, but from the exact next year, it was switched to the Python ecosystem.

It was done much later when Python became the standard in research universities, the language of recent research papers, etc.

A generation of Scienctists learned C/FORTRAN/MATLAB in college/grad school as it was taught, but they switched to Python early/mid career. Teaching Python in undergrad followed.

I also taught a mid-career Economics professor Python. She used SPSS before for her papers. Humanities professors doing data crunching are now switching to Python, too. There is a clear trend.

Post reply on HN