News for hackers. Stuff that matters.
Re:Ask HN: Why Did Python Win? by kbenson on Tuesday August 29, 2023 @06:16PM (#37314863)
> But Python is -dramatically- better focused, as a community, on finding a Pythonic way to proceed, and then advocating it, than previous cultures.

I would revise that to be that to be that the pythonic culture of one acceptable way to to is better matched with a lot of good development practices.

Perl was also very good at finding a Perl way to proceed. It's just that with Perl that often mean a lot of implicitness and "do what I mean", and multiple ways to do it so you could fit it within your preferred style and tailor it to the current project's needs.

That all sounds good until you are confronted with the flip side of the coin, which is that it's harder to understand when looking at something written with those perspectives for the first time or after a long hiatus from the project, which puts a lot of importance on policy and standards which saps effort from just getting something done.

I love Perl, and it's still the language I write most often for work, and it's no great mystery why Python became preferred.

Re:Ask HN: Why Did Python Win? by gabereiser on Tuesday August 29, 2023 @06:50PM (#37315182)
Not just practices, tooling. The whole typing system. Linting to check for mistakes. For the love of black.
Re:Ask HN: Why Did Python Win? by KptMarchewa on Tuesday August 29, 2023 @07:49PM (#37315736)
Python's static typing still feels very very clunky and bolted on, and tooling around it was rather bad, like mypy. In general I definitely wouldn't say python tooling was good. It's improving rapidly with ruff tho, just as JavaScript when esbuild appeared.
Re:Ask HN: Why Did Python Win? by mardifoufs on Tuesday August 29, 2023 @08:50PM (#37316225)
Dumb question: I know the built-in typing (import typing) is limited in some ways, but it works pretty fine to cover most basic needs. So what does mypy add? I'm super interested in adding typing to some code we have but I'm just a bit confused by the choices available.

Would mypy with pydantic be a good combination or do they overlap?

Re:Ask HN: Why Did Python Win? by woodruffw on Tuesday August 29, 2023 @08:54PM (#37316263)
The two are complementary: the built-in `typing` module only provides type annotations, not type checking. Mypy provides the latter, via the type annotations that you (and others) add to Python codebases.

Pydantic overlaps with mypy in the sense that it provides a mypy plugin, but otherwise it's just like any other Python library.

Re:Ask HN: Why Did Python Win? by mardifoufs on Tuesday August 29, 2023 @09:10PM (#37316388)
So mypy runs "at run time"? I guess that makes sense, I thought the annotations provided some form of checking too, but now I realize that I should really spend some time to inform myself better :').
Re:Ask HN: Why Did Python Win? by woodruffw on Tuesday August 29, 2023 @09:23PM (#37316496)
Sort of -- mypy is its own standalone program, and you run it to typecheck your program's type annotations. It does some evaluation of the Python program (specifically imports and some very basic conditional evaluation, among other things), but it never really executes the codebase itself.
Re:Ask HN: Why Did Python Win? by stableviper on Tuesday August 29, 2023 @09:22PM (#37316477)
No, it's more that pydantic runs "at run time" while mypy not.
Re:Ask HN: Why Did Python Win? by gabereiser on Wednesday August 30, 2023 @12:48AM (#37317799)
Mypy runs as a type linter/checker. See https://mypy-lang.org/
Re:Ask HN: Why Did Python Win? by bmitc on Wednesday August 30, 2023 @03:11AM (#37318642)
Isn't Python's tooling usually considered some of the worst?
Re:Ask HN: Why Did Python Win? by gabereiser on Wednesday August 30, 2023 @08:53AM (#37321290)
By what standard? Yours? Java developers? Rust developers? The fact that Python has typing now, tools to check those, and has plenty of tooling around “make it faster”, I think your world view might be stuck in 2010. Python has gone from a slow obscure scripting language to a powerhouse. Conda, NumPy, Scikit, PyTorch, GPU programming, Games, Analytics, web apps, API’s, I think it’s safe to say this ain’t your grandpa’s Python anymore.
Re:Ask HN: Why Did Python Win? by bmitc on Wednesday August 30, 2023 @09:28AM (#37321844)
I have seen Python in action since 2010 plenty of times, including the present. It's been a mess every time. My worldview is driven by F# and Elixir, namely the `dotnet` and `mix` tooling, respectively. So no, Python's tooling does not impress me in the slightest. The first thing you need to do is get agreement on all the different checkers, linters, formatters. For Elixir, there's one tool for each task. My worldview feels quite current.

Those other things you mentioned aren't relevant to tooling. They're distributions, libraries, and applications. But note that Conda's existence was basically due to the fact of Python's tooling being poor.

Re:Ask HN: Why Did Python Win? by gabereiser on Wednesday August 30, 2023 @10:36AM (#37322775)
You see tooling in a different view than typical Python users. Python users see things like iPython, notebooks, the ability to quickly do statistics and plot results, as tooling - to do their jobs. Data Science. Machine learning. Things that perplex and confound static-typing OOP purists. So yes, by your world view - Python is a mess. There's no one way to do things, there's no one tool, no one linter, no one formatter. I praise the fact that there isn't. What a boring world. What choice would you have if that tool didn't satisfy your needs? Find another language?

I began in that world view. The C/C++/Java/DotNet everything must have a standard, a fixation on a singular consensus. That's not how things work in the open source world of Python, javascript, rust, etc. Will there be gravitation towards a paradigm? sure, until such time that a new one emerges.

If you looked at Python in the 2.5 days and looked at Python today - You cannot argue the tooling has gotten better.

Re:Ask HN: Why Did Python Win? by bmitc on Wednesday August 30, 2023 @10:59AM (#37323184)
> You see tooling in a different view than typical Python users.

That doesn't surprise me.

I do what you mentioned with F# in Polyglot Notebooks (which support several languages in the same notebook) and Elixir in Livebook all the time, both of which are superior notebook implementations to the outdated Python Jupyter notebooks.

My worldview is not driven by comparing Python to C#, Java, C++, and other such ilk.

Re:Ask HN: Why Did Python Win? by 2colours on Monday September 04, 2023 @01:41PM (#37382910)
So following your logic, "some of the worst" includes the vast majority of actually used languages and tools. Must be cool to be on the special side. :)
Re:Ask HN: Why Did Python Win? by v3gajerusalem on Monday September 04, 2023 @02:31PM (#37383407)
They want to be lisp SOOO BAD! =)
Re:Ask HN: Why Did Python Win? by cutler on Tuesday August 29, 2023 @06:52PM (#37315215)
But Ruby took all the best bits of Perl so I'm still perplexed as to why Python "won".
Re:Ask HN: Why Did Python Win? by bb88 on Tuesday August 29, 2023 @07:32PM (#37315582)
Ruby did have a lot going for it about 15 years ago. Many Java/JSP people jumped ship and got on the ruby train. Ruby was a breath of fresh air comparatively.

Python had a great community though, and the Python Software Foundation went out of it's way to make people feel accepted in the community. And frankly programming is often more of a social activity than most people realize -- particularly for new programmers.

So new programmers tended to lean towards python, because the resources to lean on others were there. And people like Raymond Hettinger, Naomi Ceder, Ned Batchelder, and Yarko Tymurciak were approachable even if the BDFL wasn't.

Re:Ask HN: Why Did Python Win? by selestify on Wednesday August 30, 2023 @06:50AM (#37320069)
What did the PSF do to make people feel accepted?
Re:Ask HN: Why Did Python Win? by cdchn on Tuesday August 29, 2023 @08:38PM (#37316133)
Because the best bits of Perl were kinda trash that Python was smart to avoid.
Re:Ask HN: Why Did Python Win? by danmur on Tuesday August 29, 2023 @11:30PM (#37317337)
Yeah for sure, the PERL influence is why I dislike Ruby. Makes it really hard to read if you haven't been doing it constantly.
Re:Ask HN: Why Did Python Win? by cdchn on Wednesday August 30, 2023 @12:34AM (#37317707)
Python's clean, obvious syntax is what drew me to it. They actively decide to not do things because it detracts from the cleanliness of the syntax. Very often, less is more. My biggest fear is Python might be forgetting this, which I see with the sort of things like := operator, etc.
Re:Ask HN: Why Did Python Win? by cutler on Wednesday August 30, 2023 @08:00AM (#37320720)
God forbid we should have to familiarise ourselves with a language before using it.
Re:Ask HN: Why Did Python Win? by cdchn on Wednesday August 30, 2023 @10:05AM (#37322362)
God forbid things be intuitive.
Re:Ask HN: Why Did Python Win? by KingMob on Thursday August 31, 2023 @02:00AM (#37333011)
Funny, because 99% of current regex libraries use Perl's regex extensions.
Re:Ask HN: Why Did Python Win? by 2colours on Monday September 04, 2023 @01:38PM (#37382864)
Taking a look at the bigger picture, it does indeed seem like the Perl philosophy lost to the Python philosophy overall.

Looking at the hip n cool languages, not just Python for scripting but surely Go and to some extent Rust as well for native stuff (Dart for scripting also but it didn't outright "win"), these are mostly languages that deliberately simplified things. Yes, even Rust - it needs to be compared to C++ and its biggest feature is basically that it doesn't let you do all the things C++ does, within a very similar model.

The only language that I heard is going against these trends (but I'm largely clueless what it's actually like) is Julia which sort of has its own "lay" niche like Perl did back in the day, and is mostly winning based on the premise that it's a performant scientific language.

The industry obsesses over costs of adoption, stability, maintenance; in short: how to get the most out of the least actual new development. It does make quite a lot of sense, to be honest, although sometimes it's really demotivating at an individual level.

And frankly, "learn the language, duh" usually comes up when the language is complex or unintuitive for no practical purpose. Of course there will be people who always complain if they have to learn anything but I don't think they make the majority, or even a significant minority, in the software engineering world. "Learning the language" is only as much of a virtue as the language itself serves its purpose, which includes easy of use and the readability of someone else's code.