Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

851–856 of 856 posts

Re: Ask HN: Why did Python win?

#851
post #68

Earlier quoted context omitted.

> 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

A bizarre opinion to be sure. Python is vastly more readable then Perl and is far easier to write as well, hence so many educators in schools reaching for it.

I can understand a love of Perl by folks who love a good puzzle, or who are interested in "code golf" (trying to get something done in the fewest number of characters).

But those are not great traits for a general-purpose programming language. I agree with the other response: "Python just forces you to write code that's better for the team."

Re: Ask HN: Why did Python win?

#852
post #68

Earlier quoted context omitted.

> 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.

Nowadays in languages like C/C++/Go/etc we typically enforce the use of an autoformatter to convert source code to a canonical style. It's also great for removing all discussion of such formatting from code reviews.

Re: Ask HN: Why did Python win?

#853
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.

> 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. TBH, community had nothing to do with Python's enormous success over its competitors (Perl, and Ruby. Possibly Tcl too.). Nor did any technical merit, nor ergonomics. There's one, and only one, reason why Python exploded…

I don't think your analysis is accurate.

My experience of trying to get my own C functions to use in Python to have been nightmarish. Yes, you can do it... if you have exactly the same compiler & version used to produce the python interpreter itself.

C's only usefulness to Python is: it allows optimization of the 80/20 or 90/10 rule, so performance doesn't have to totally suck with Python.

Python 'won' IMHO because it hit a sweet spot -- simple enough for beginners, in fact, beginner-friendly, but due to having a good basic set of datatypes (lists, tuples, sets, plus the usual ints, floats, and complex) -- this allowed complex ideas to be compactly expressed. The ability to switch between functional and imperative styles also helped.

Python is a 'good enough' lisp. MIT switched, and Norvig has said as much.

No, the astonishing thing is that Python survived the 2->3 transition, and came out stronger on the other end. Language cleanups, new 'syntactic sugar' (e.g. @ as the decorator syntax), and what you see is Python is trying to actively steal all the successful programming paradigms under one unified syntax.

Is python perfect? Hardly. But it's beginner-friendly and expert-optimized. AND, unlike C++ (at least for me), you can get ALL of Python into your head at the same time. (Libraries, ok, but true in any language). In this specific sense, it is exactly like C (you can keep it all in your head, even the edge cases).

There are newer languages gunning for a piece of Python's mindshare (Zig, Nim). But because Python is a moving target: getting better and better, the others will need to provide a spectacular use-case advantage --- and I just don't see that happening.

Re: Ask HN: Why did Python win?

#854
post #433
post #414

Earlier quoted context omitted.

Not just perl, but C/C++/Java as well. Ruby was a competitor to Java JSP development back in the day. And I remember when a lot of Java people jumped ship to Ruby. I moved from C++ to python over a decade ago and never looked back. Back then, the python jobs were scarce -- but based upon how I picked up the language, many of the typical C++ issues just disappeared -- and I knew it was going to become popular. One com…

MIT dropping SICP/Scheme for Python conicided with the general decline of education as an end in itself. Python is the VHS of computer languages. I couldn't believe it when I heard MIT dropped a language renowned for its elegant lambda implemenation in favour of a language in which lambdas were not only frowned upon but literally throttled. I think it says everything that MIT ditched Scheme and SICP at the same time…

I suggest you read the reasons that MIT switched: https://www.wisdomandwonder.com/link/2110/why-mit-switched-f...

and https://www.johndcook.com/blog/2009/03/26/mit-replaces-schem...

and https://vimeo.com/151465912#t=3577s

As to being 'near impossible' to teach SICP with Python: https://web.archive.org/web/20210916151732/https://doc-04-5g...

Re: Ask HN: Why did Python win?

#855

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

> Readability counts. In what way is numpy readable?

It's designed to be familiar to people who know Matlab. Matplotlib bears the same burden. Sometimes you have to start with something that's familiar to users and slowly change when you have people on board.

Re: Ask HN: Why did Python win?

#856

Earlier quoted context omitted.

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.

> and is faster.

After a very long warmup time, which may make one-shot applications much slower.

Post reply on HN