Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

341–350 of 856 posts

Re: Ask HN: Why did Python win?

#341
post #155

Earlier quoted context omitted.

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.

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.

Re: Ask HN: Why did Python win?

#342

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…

> 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

Re: Ask HN: Why did Python win?

#343
We are in a verrrry similar boat! Always been into fiddling with computers but got my first job in tech around 2013. JavaScript and PHP. Only the past couple years have I messed around with Ruby + RoR and I love it.

Every time I have to touch Python to mess around with anything going on in the ML space, it just feels so clunky, in ways that Ruby feels like it wouldn’t have trouble with.

I think r_thanbapillai’s top level comment is spot on. Ruby became a “web” language because of the singular focus on Rails (at least in the west) which hampered its growth in other areas. It’s not so much the language that makes a community but the libraries people are inspired to build with it. Python specialized in the “right” thing for its moment in the sun.

I do think we're slowly seeing Julia or other more purpose built tools slowly eating python’s numpy lunch.

Re: Ask HN: Why did Python win?

#344
I've always just thought it was just the universities. They train people in Python, which meant that people who had low level libraries written in C\C++ could wrap their utilities in Python so as to capture a larger audience...But I also know that DHH went after a lot of these enterprise software self-promoters shilling "clean code" and they then turned around and bad mouthed him and the Ruby programming language at conferences and podcasts (for years). I can remember hearing from a few different shysters that "ruby is a redundant language when you have python". That sort of negative publicity can have a bad effect on an ecosystem. My two cents.

Re: Ask HN: Why did Python win?

#345
post #68

When I first encountered Python, it was as an alternative to Perl. Given the choice between Perl and Python, I think it's clear why the latter won out.

> When I first encountered Python, it was as an alternative to Perl. Me too I am amazed that Python won out against Perl Perl is much easier to use. Does not have the incredibly irritating treatment of whitespace Perl was a disrupter, whereas Python was "computer sciencey". A false dichotomy but it really mattered to people

Some people (me included) LOVED the whitespace-as-a-feature. I had swam through too many scripts where everything (regardless of nesting level) was all on the first character of a line or otherwise spaced randomly where my first step was to properly indent just to understand what it was doing. A language that enforced that was a Godsend.

Re: Ask HN: Why did Python win?

#346

> My impression is that in the ‘00s, Python and Ruby were both relatively new, dynamically typed, Your impression is wrong. Python goes back to 1988. It was known in FOSS circles in the 90's: a minority within a minority. The rise of the web exposed more programmers to FOSS, due to pretty much everyone in web eventually having to work with GNU/Linux servers. More developers than ever were suddenly exposed to cruft th…

Wikipedia suggests that Python debuted in 1991, with Ruby following in 1995.

I haven't checked, but I seem to recall that Python started out as a successor to the ABC language in around 1988 or 1989 or so. The initial release may have been in 1991?

Re: Ask HN: Why did Python win?

#348
Here's my take.

Ruby essentially stole the thunder from Perl and PHP as the language for back-end development with Rails. But with Django, Python pretty quickly had a more or less equivalent web framework.

Here's my recounting of history:

- For about a decade, Rails remained one step ahead on the cutting edge of web development. Thought leaders like 37 Signals / Basecamp constantly rolled out innovations through Rails, appealing to the most forward-thinking web devs. But Python was never far behind.

- I would also argue that Python is an easier to understand language. Ruby encouraged the development of DSLs with its second-class functions / block syntax, but Python tried hard to keep its core language simple and emphasized explicitness.

- Meanwhile, the simplicity of Python's syntax made it very appealing for developing data tooling, competing with a bunch of expensive proprietary tools, like MATLAB. This exploded Python's userbase.

During this period, I would say Ruby was the hotter language for startups, but Python had a bigger userbase, as the more middle-brow option.

Starting around 2015, both languages started to see other languages encroach on their web dev moat. Node was better suited for simple microservice APIs. People got into typed programming for its perceived advantages. Compiled languages took on a lot of the high-performance systems.

Re: Ask HN: Why did Python win?

#349

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…

I think it's kinda nonsense. No programming language is intuitive. It's arcane by nature. Having slightly more concise syntax saves you maybe a week of learning time. I used to write Perl about as fast as I could think because I had a lot of practice with it. I mostly do Python now, but do a lot less coding in general and I have to google syntax constantly. Python is less noisy, but it's not really more intuitive for me.

Frankly I think language design is secondary to IDE integration. The only time I've ever coded without thinking at all was using Java with IntelliJ or C# with Visual Studio. Type-matching and library introspection all work flawlessly 99% of the time. Not only do I not need to know the details of syntax, but I didn't even need to know APIs because I could autocomplete everything all the time. Python with VS Code still feels stone age by comparison.

Re: Ask HN: Why did Python win?

#350

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…

I think a good part of the issue is that right around then, Perl decided to do Perl 6. People decided to wait on doing anything big, since Perl 6 wouldn't be quite compatible. Later it turned out to be extremely incompatible. And Perl 5 would be dead long term, so why spend time on it, when you'd have to do a radical rewrite soon? Meanwhile, Python was there. And Perl 6/Raku took 15 years to finally arrive in some fo…

Perl 5 to Perl 6 transition took so long that python had it's own internal crisis with Python2 -> Python3 transition inside of that (and handled it far better).
Post reply on HN