Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

581–590 of 856 posts

Re: Ask HN: Why did Python win?

#581

Python ended up 'specializing' in data contexts, thanks to Numpy / Pandas, and as a result, ended up becoming the first exposure to programming than anyone doing data stuff had. That was millions of people. In that space, it had no competitors. Ruby ended up 'specializing' in web dev, because of Rails. But when Node and React came out, Ruby on Rails had to compete with Nodejs + React / MERN as a way of building a web…

I think Python was popular as a general-purpose language first. After all, there was a reason people put so much effort into writing Numpy in the first place. I think a lot of people were attracted to the language design, as captured in the Zen of Python ( https://peps.python.org/pep-0020/ ), such as: Explicit is better than implicit. Readability counts. Errors should never pass silently (unless explicitly silenced)…

Well, also, if you're going to write something like Numpy, Python is the most hospitable language for it. C extensions really are a superpower of the language. It would not be easy to achieve a similarly effective result while working through a more standard-issue foreign function interface.

Re: Ask HN: Why did Python win?

#582
I was writing both about ten years ago, and ditched Ruby with great joy after wrestling with dependency management. It isn't great in python, but Jesus, it was awful in ruby. I haven't bothered writing in it since.

Re: Ask HN: Why did Python win?

#583

Earlier quoted context omitted.

Python has a default None return, Ruby returns the value of the last expression. Neither (except maybe the None case in Python) is really implicit, Ruby is just an expression oriented language while Python is statement-oriented. OTOH, in Ruby the keyword “return” is superfluous except for altering control flow for an early return, while in Python it is the mechanism for supplying a return value.

> Python has a default None return, Ruby returns the value of the last expression. I would really hate this feature in a language without strong static typing.

Doesn’t seem like that big of a deal. You’re going to have a really hard time getting your first test to pass if you make a mistake.

I don’t mean using testing as a poor man’s type system, I mean even the tests you would write in a statically typed language will quickly uncover any mistakes you could possibly make there.

Re: Ask HN: Why did Python win?

#584

Earlier quoted context omitted.

Back when I decided it was time to add a scripting language, Perl and Python seemed like the obvious choices, and in my mind were equally good options. I asked my best friend which I should choose, and he more or less said, "You can't go wrong with either one, but when you ask for help Perl people are assholes and Python people are nice." I can't confirm his thoughts on Perl and I haven't interacted much with Ruby, b…

yep the Perl community kind of had issues around the turn of the millennium and the perl6 debacle did a lot to convince people that Perl was kind of a dead end. I don't think there was any toxicity in the Ruby community but it was made up of working programmers where as the big leading voices in the python community was teaching assistants and students so it might have been more tailored to newbies. I don't recall th…

> I don't recall there being much real industrial use of python prior to Ruby emerging even if python is technically older

Yeah that's my recollection too. About 2011ish there weren't a lot of jobs in python yet. Perhaps in SV, but not out in the real world. Several startups were doing it, including Youtube and google at the time.

But in the F500 world, python wasn't used at all. I started using it in 2008/9-ish.

Re: Ask HN: Why did Python win?

#586

Python ended up 'specializing' in data contexts, thanks to Numpy / Pandas, and as a result, ended up becoming the first exposure to programming than anyone doing data stuff had. That was millions of people. In that space, it had no competitors. Ruby ended up 'specializing' in web dev, because of Rails. But when Node and React came out, Ruby on Rails had to compete with Nodejs + React / MERN as a way of building a web…

Numpy and Pandas existed as they did because Python is written in C and cooperates so well with C, so I believe that would be the better answer.

Re: Ask HN: Why did Python win?

#587

The way I (somewhat hazily) remember it, Python was mainly competing with Perl as a scripting language, not Ruby as an application/web language. I started hearing about Ruby years later when Ruby on Rails drove the Web 2.0 movement, but that feels like a different era to me. Eric S. Raymond wrote an article[1] in 2000 about his experience trying Python after spending a lot of time with Perl. I'll quote some of it her…

That's a nice way to put it, I get the same feeling with Python. I pick it up now and then and I always seem to get it to do exactly what I need real fast. It just works, has a library for what you need, and its usage is clearly explained in English in the docs. Compare that to Go for example, the other language I know, and it's not even close.

Re: Ask HN: Why did Python win?

#588

Earlier quoted context omitted.

The amount of complexity that Rust adds is not worth in most scenarios in my opinion. I can think of Rust as something for OS with critical safety or so. Besides that, in real life you end up having C in most of your software, so I am not sure how Rust behaves compared to well-written C++ with all warnings and linters on and using smart pointers. But my hypothesis is that they do not stay very far apart in safety. Th…

All this may be true (I'm not the strongest C++ developer in the world, relatively limited exposure), however the Rust memory management via the type system feels natural once you wrap your head around it. That idea is really good. I always hated dealing with `delete`, `free` and `malloc`. Being able to offload all that busy work to the type system is just nice. There are definitely ergonomic improvements that could…

I.write c++ all the time, and I go months between needing new or delete. Unique_ptr is a wonderful thing. Not quite as powerful as rust's borrow checker, but it saves me a lot of thinking.

Re: Ask HN: Why did Python win?

#589

Earlier quoted context omitted.

I believe what you describe is basically a preference for a language you already know. I'm quite proficient in JavaScript and could repeat everything you say about ... JavaScript. OTOH I had to do things in Python a bunch of times, and it was always very frustrating.

The JavaScript ecosystem is objectively smaller. JavaScript doesn’t have a foothold in data science and ETL, nor deep learning, nor DevOps. There are no decent ORMs in JS, and Python has several. JS is poor for numerical and scientific programming.

Prisma is better than any Python ORM in my opinion.

Re: Ask HN: Why did Python win?

#590

Earlier quoted context omitted.

The only ruby person i've met was insistent that ruby was the one true way and he trued to force it into everything. That attitude turned me off. Of course I already knew Python, and so did the rest of my team so we had been doing tools in Python (the guy wasn't on my team), but until he pushed ruby into places where python would have been better (import a Python library rather than shell to out to a program) I was w…

The only ruby person i've met was insistent that ruby was the one true way That sucks. I've been doing Ruby full-time since 2014 at 4 companies and I've never seen that sentiment, even from people who really love it. My experiences have been really positive.

My experience with python was simply, people wanting to get shit done. This was circa 2008. They weren't really engaging in language wars, but doing innovative things like extending Java, with Jython.

I was arguing for the F500 company I was working on to explore using Jython to write unit tests for Java code.

Why not have a scripting language to write unit tests for Java code?

I see this with Rust trying to extend python in interesting ways. I don't see this with Java trying to extend C/C++ or Python.

Post reply on HN