Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

591–600 of 856 posts

Re: Ask HN: Why did Python win?

#591
post #428

Earlier quoted context omitted.

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.

Maz (ruby author) is nice and so we are nice, isn’t so bad. It’s twee sounding but saying you are going to follow the example set by the founder is absolutely fine. Is it any worse than the Python ‘benevolent dictator for life’ example?

I'm going to answer your question directly: No, it's not worse.

My interactions with Guido haven't been awesome. But the people put up with him regardless. The other people in python have been awesome.

Re: Ask HN: Why did Python win?

#592

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

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…

I disagree: Python seems to have a zillion build tools and multiple competing type-checkers.

Re: Ask HN: Why did Python win?

#593

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.

I agree. I’ve found ruby and its developers to be pretty friendly and open to other languages and styles.

Re: Ask HN: Why did Python win?

#594
Your view of history is not accurate. Python and Ruby were not really competing back then for building web apps. The most popular languages for that in the 00s were Perl and PHP. Ruby on Rails came along and became popular for a while and some popular sofware was written with it.

But Rails based apps then quickly developed reputations for performance issues and for managing gem dependencies being a nightmare. Then Node came along and was the new exciting thing. npm was easier to use and a lot of people jumped on that for a while. It was exciting because most of us were already fluent in JS. So it was just using a language we knew in a new context rather than picking up something totally new.

Why is Python the soup du jour lately? Well it has been around for a while and has a reputation for being mature and having mature libraries. It also became the best language to hire junior devs because of its ubiquity in US universities. Even if you don't go into CS as a major or minor there's a good chance of getting exposed to Python. It also has some advantages for collaborative codebases like the language itself being opinionated on formatting and having lots of well developed tools.

Is it the Right Choice(tm)? I dunno. It definitely has downsides as well. But every team has to decide for themselves, and not all good reasons are technical (eg the larger pool of junior devs today than say, RoR.)

Re: Ask HN: Why did Python win?

#595
post #569

Earlier quoted context omitted.

Are you from the future? R is making progress to replacing SAS in pharma, but has a long ways to go. Here is an article from last year[0] patting themselves on the back for making a R submission to the FDA. There are oodles of existing processes where data has to be formatted just so because that is how SAS does it. Nobody wants to rip up and re-validate that code until they must. [0] https://www.r-consortium.org/blo…

The trope about SAS being required is pretty old... people trotted that out when I last worked in pharma ~15 years ago. The FDA specifically released an article saying that R is perfectly acceptable for submission https://blog.revolutionanalytics.com/2012/06/fda-r-ok.html Please don't spread the SAS FUD. I work in Pharma and talk to the statisticians all the time.

I currently work in pharma, and I can point to teams of SAS programmers. There are definitely R efforts, and I have no doubt it is the eventual future, but it is not yet here.

Re: Ask HN: Why did Python win?

#596

Earlier quoted context omitted.

That’s any code I haven’t looked at for a while, to be honest. I can’t count how many times I’ve looked at code I wrote or bug tickets I fixed and have absolutely no memory of doing it. It’s almost like the act of committing flushes the local storage in my brain.

I run into this problem as well I'll often come across something I wrote a few years ago and struggle to remember why I wrote it that way. I've learned to add comments to my code - from what I see commenting code is frowned upon by a certain subset of developers but I've taught myself that whenever I am doing something subtle or unintuitive to add a short comment explaining what the code is doing, for every potential…

> from what I see commenting code is frowned upon by a certain subset of developers

I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a... belief.

Re: Ask HN: Why did Python win?

#597

Earlier quoted context omitted.

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.

Judging by the very contentious opinions on it, I'd rather stick with ORMs that have been chugging along for over a decade without fail.

Re: Ask HN: Why did Python win?

#598
Back when I read the O'Reilly book on Ruby on Rails, it liberally referred to "Why's Poignant Guide to Ruby."

That's when I realized something: The book, and thus Ruby on Rails, appealed to teenagers as their first programming language.

Teenagers get very passionate about things, and emotionally involved with their choices.

Python is a tool. Good tools are boring, and don't come with references to bacon and other grammatical jokes. They are about performing a task; and they don't need to entertain in order to keep a teenager's attention.

I look at RoR as a way that many young people got excited about programming, but not really the best tool for the job. It deserves a place in history next to Visual Basic, because it met people where they were and allowed them to build something "good enough" when other tools were too difficult or time consuming to use.

Re: Ask HN: Why did Python win?

#599

Earlier quoted context omitted.

JIT may not be the correct thing to call it. At least in my head, any script that doesn't need to be compiled by the dev or the user before running is JIT. It's the scripting vs building difference to me. If that's not correct, then I'd love to be corrected. Here's my reference: https://en.wikipedia.org/wiki/Just-in-time_compilation

JIT is a compilation model for interpreted languages, which translates bytecode into machine code in runtime to obtain better performance. The opposite of JIT is AOT (Ahead of Time). JIT languages go through two compilation steps: one to bytecode, and another to native code in runtime. Java is one example of a JIT compiled interpreted language, that also does ahead of time compilation to bytecode, while python compil…

> (though this expression doesn't really make any sense, as slowness is a property of the implementation, not of the language)

Yes, which is why this is the way CPython works, but PyPy uses JIT and is faster.

Re: Ask HN: Why did Python win?

#600
post #78

Python grew out of a myriad of applications that built on hard to replicate components, while Ruby relied only on web development which is remarkably subject to fashion. Python is very simple making it easy to learn. Thus, it became more and more popular for fields where programming is not the main task, like science. It is also very easy to extend with C. So, these fields could bolt on time-tested scientific code in…

> Python is very simple making it easy to learn. I would argue that there's little difference between them in ease of learning. I personally found Ruby easier because everything being an object with methods and no free floating functions felt more natural and easier to look up. i.e. string.length over Python len(string)

Ruby has implicit imports which pollute namespaces. This is extremely annoying for anyone who wants to learn the language. It uses extensive monkey patching, which is once again a substantial challenge for a beginner that wants to understand what their code is doing. It has a nicer syntax with procs and lambdas but syntactically distinguishes between them with different ways of invoking functions and all the issues associated with bindings. In Python all functions look and behave the same, to the point where methods have an explicit self argument to make it clear that they're just regular functions (the semantics for function binding could be easier but then again such is the case in all object oriented languages).

Python's challenges are superficial syntax; the semantics are extremely uniform everywhere and don't suffer from special cases galore.

Post reply on HN