Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

421–430 of 856 posts

Re: Ask HN: Why did Python win?

#421
post #155

Earlier quoted context omitted.

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

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.

Re: Ask HN: Why did Python win?

#422
post #111

Earlier quoted context omitted.

Why probably wrong? Bioperl was very big in the bioinformatics world.

> Why probably wrong? Because I don’t have a great memory and I was never into Perl so I was extremely unsure of the suggestion and didn’t want it to come across as an assertion.

James Tisdall and O'Reilly produced "Beginning Perl for Bioinformatics" which sold like hotcakes at Perl conferences.

Re: Ask HN: Why did Python win?

#423
post #122

Earlier quoted context omitted.

You're forgetting the period of Ruby's popularity in the devops world, especially Chef and Puppet.

I think that's just building on RoR hype in that same field. Puppet even moved away from Ruby AFAIK.

I beg to differ. Most sysadmins I knew who used Ruby extensively had never touched Rails. There's no real connection between the two phenomena other than the language.

Re: Ask HN: Why did Python win?

#424

Earlier quoted context omitted.

> There should be one-- and preferably only one --obvious way to do it. This is so hilariously wrong in python though

That was the one mantra from the zen of python that I always laugh at too. Because my #1 complaint with python is that there are so many ways to do the same thing. It sounds nice in theory if you are a new developer because you can create your own voice in python and character. For example, lets say I gave a simple coding puzzle (think leetcode) to 10 python engineers. I would get at least 8 different responses. A fe…

Either you move with the times or you become obsolete. 20 years ago Python codebases were clean and consistent, but language design has moved on, and Python has - barely - kept up with it, so now you have people who know the new ways and people who know the old ways and various stages in between (and it's not like they didn't try ditching backward compatibility, but that didn't work out well either). Go has the luxury of starting 20 years later and being a lot less ambitious, but it'll happen to Go too in time.

Re: Ask HN: Why did Python win?

#425

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…

Python also had a near death experience with the Python 2 to Python 3 transition, it could have wound up like Perl did with Perl 6 but I think the data science use case really made it.

Overall I think Python is the best language for the non-professional programmer who wants to script things and put their skills on wheels.

Re: Ask HN: Why did Python win?

#426
post #329

Earlier quoted context omitted.

> There should be one-- and preferably only one --obvious way to do it. This is so hilariously wrong in python though

I like Python, but most of the Zen has always been a meme, and not a guideline of design principles of either the language, or software written with it. Besides the one you mention, I also find the "Explicit is better than implicit" line to be against everything Python stands for. The language is chock full of implicit behavior, and strongly encourages writing implicit code. From the dynamically typed nature of the l…

I code both.

> explicit over implicit

Go was the first language I used that broke an explicit check for nil/null/None. I had to cast my nil to a different kind of nil in order for the program to run correctly. C/Python/Java/C++ didn't have this issue. Null was always null in each of these languages.

Further, go panics in surprising ways sometimes. A library developer might decide to panic and cause your program to crash, when that library was only used in your program for optional behavior.

Re: Ask HN: Why did Python win?

#427
Python didn't win, really, in any meaningful sense. It's probably the most ubiquitous language, because it's a great teaching language, and works reasonably well for a bunch of different kinds of users -- but only to a point. A jack-of-all-trades is a master of none. It's extraordinarily difficult to use Python in large, high-scale, or otherwise non-trivial systems. (Same is true for Ruby, for the record.)

Re: Ask HN: Why did Python win?

#428

Earlier quoted context omitted.

So I imagine you have that perspective because you started less than 20 years ago. In some ways the idea of the Pythonic Way to do things evolved in opposition to Perl's vigorous advocacy of More Than One Way. Python has been really winning for some time, so it's natural that its ideological discipline has grown ragged. The crop of kids who value options above consistency don't have the scars of the Perl age to infor…

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…

I can't imagine Python's welcoming community has anything to do with it. If anything it was Ruby that had a reputation for being the most welcoming community with its MINASWAN (cringe) philosophy.

Re: Ask HN: Why did Python win?

#429
post #393

Earlier quoted context omitted.

> And I can't think of anything in the ruby language itself that is implicit over explicit This is surprising to me. I love ruby, but it embraces implicitness more than any other language I've used. method_missing, monkey patching internals, and other types of metaprogramming make things very implicit at the interface level

If you want to really experience the true horror of implicit try Scala.

Scala's implicits are a lot less unpleasant because the type system means that you (and, perhaps more importantly, your IDE) know exactly where they're happening.

Re: Ask HN: Why did Python win?

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

This is a good point.

I've done a fair bit of R and there is no doubt that as a pure data science tool it's usually quicker to produce something than Python.

But I prefer Python because inevitably any data science project ends up having other "bits" that aren't pure data science, and Python's super string general purpose computing libraries are hard to beat.

Post reply on HN