Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

151–160 of 856 posts

Re: Ask HN: Why did Python win?

#151
post #31

I first encountered Python around 2000. At the time Perl was more popular in the circles I frequented, and TCL probably about as popular as Python (eggdrop[1] notwitstanding), but Python was growing steadily. I encountered Ruby in the late '00s (as others have noted it made its english-language debut almost a decade after Python started) and Lua was another contender during this time. My memory is that, at least outs…

Before Python got popular, Perl was the most similar popular language. Once I encountered Python, I felt, this is Perl, but done right.

That was my experience. I like Perl. I'm comfortable with Perl. And after about a day of Python, I never wrote another line of new Perl code.

There were so many "it can't possibly be that easy, but it is!" moments.

Let's write a function to add five to a number:

  def add_five(num):
      return num + 5
OK. So, can I pass that function as an argument to another function?

  def call(func, value):
      return func(value)

  call(add_five, 10)
  => 15
What? That worked?! And there was zero additional syntax, you just... do it?

After a seemingly endless list of happy discoveries like that, I seriously rethought my idea of what programming languages could be, and ought to be.

Re: Ask HN: Why did Python win?

#152

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…

There is a lot more history before the data part. But yes, it is a big "modern" driver for its popularity, and Python owes it to its easy C interop.

I would contest the Ruby as web dev part, though. I used Ruby for Puppet and Vagrant a long time ago and it was great, but all my experiences with Rails (and associated gems) turned into maintenance nightmares.

Re: Ask HN: Why did Python win?

#153

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…

Good memories. I still have that issue in the attic somewhere.

Re: Ask HN: Why did Python win?

#154
post #76

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 is certainly amazing, but there are tons of competitors in the data/scientific space, which pure "A-type" data scientists tend to prefer: R, SSPS, Matlab... The difference is that Python doesn't entirely suck as a general-purpose language. Sure, you might have better options, but it's still reasonable to write almost anything in Python. Other scripting languages like Ruby, JS and Lua are probably a little bit b…

numpy exists (somewhat indirectly) because matlab cost $$$. and now numpy is a far larger use of matlab's concepts than matlab will ever be.

I haven't seen anything an "A-type" data scientist needs in R/SAS/SPSS that was intrinsic to the language and couldn't be ported to Python. I don't want a "data/scientific" language, or a "web" language, or a "UI" language- I want one language that explicitly supports all the usecases well-enough.

Re: Ask HN: Why did Python win?

#155

Earlier quoted context omitted.

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)…

Only one of the items in your "such as" list is unique to python's philosophy, and that is "there should be one way to do it". Ruby embraces the many ways to accomplish something, it's true. However, the three others are not unique to python. Ruby especially embraces "readability counts". And I can't think of anything in the ruby language itself that is implicit over explicit. Perhaps you are thinking of rails and co…

Ruby has implicit return values for methods, but unless I'm wrong, so does Python.

Re: Ask HN: Why did Python win?

#156
post #69

python does many things well ruby does one thing very well So apparently the "do one thing well" thingy doesn't always hold

That one thing, RoR, isn't the best option at all today.

The moment that XHttpRequest came to be - it started the countdown to RoR's popularity decline. HTML5 just made it permanent.

Re: Ask HN: Why did Python win?

#157

I have never encountered a language as easy to pick up and do cool stuff with as Ruby is. Even after years of working with it I still find Python to be a bit of a mess. I think there was an article years ago about how some people liking a product means it is going to die? I'm pretty sure that is me for technology.

https://arstechnica.com/science/2015/12/certain-customers-sp...

> If products you like keep getting discontinued, get used to it.

Well that's me. I used Windows Phone 8, my favorite phone of all time was the Blackberry Passport and my first iPhone is likely the last iPhone Mini ever.

At least the Steam Deck seems to go against that trend...I hope.

Re: Ask HN: Why did Python win?

#158
This is just a feeling, but for me I was tired of the quirkiness of Perl, and Ruby offered yet more quirkiness.

Python offered an opinionated and more crisp proposition, stating explicitly the goal among other things of having (paraphrasing the quote, so it might not be byte for byte) “one clear preferred way to do it” as opposed to the wild west that came before.

And it had Google’s endorsement (Google was still respected at the time).

JavaScript… wow. I think it’s gotten better now with more tooling and a rich ecosystem, so more power to it.

Re: Ask HN: Why did Python win?

#160
So instead of the original long-winded pour-down: Python is good enough and easy enough. And it made it a thing for people interested in solving stuff with software - as opposed to people making software to do stuff - and that is a crucial if subtle distinction.

I don't like Python but I'm getting paid almost a decade working with it everyday and... it is good enough.

Post reply on HN