Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

791–800 of 856 posts

Re: Ask HN: Why did Python win?

#792
post #349

Earlier quoted context omitted.

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…

> 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. Well, it isn't intuitive now . It was a lot better than Perl back in 2002 or so, when it really started taking off. Now, a lot of serious Python code is simply…

That's the time frame I'm talking about. Everyone got bent out of shape over Perl's sigils and built-in variables, but if you memorized the 20 most useful ones they save an enormous amount of time. If you name your subroutines appropriately and keep them short, code will be readable no matter what. Modern node is far worse than Perl ever was:

const foo = async () => {}

Re: Ask HN: Why did Python win?

#793

Earlier quoted context omitted.

Doesn’t seem like that big of a deal. You’re going to have a really hard time getting your first test to pass if you make a mistake. I don’t mean using testing as a poor man’s type system, I mean even the tests you would write in a statically typed language will quickly uncover any mistakes you could possibly make there.

In statically typed systems, this wouldn't even compile. I'm pretty sure I'd see multiple cases where the function would return different types depending on a code path.

> I'm pretty sure I'd see multiple cases where the function would return different types depending on a code path.

Quite commonly by design, or, “why union (and sum) types are a thing”.

Something returning type “Foo | nil” is very often going to return Foo on one branch and nil on another.

Re: Ask HN: Why did Python win?

#794
Javascript is probably more popular than Python overall due to its dominance on web frontend and backend. Python is used more for data/ML stuff or general programming that doesn't fall into the web bucket, though it's fine for web backends too. Ruby's only killer app was eclipsed by NodeJS, and idk what else it was great for.

Re: Ask HN: Why did Python win?

#795
post #746

Earlier quoted context omitted.

> Maybe so, but it's not like there are a lot of languages around that are as expressive, flexible and easy to learn as python, but as fast as C. There are several languages on the JVM which are that or better. As fast as C, no, but JVM is considered fast enough for a lot of applications where performance matters. > JS is probably the closest, but not because of superior language design There's this myth that Python…

>There are several languages on the JVM which are that or better. As fast as C, no... Like what? None of the ones i know of meet the "expressive, flexible and easy to learn as python" test. > There's this myth that Python as a language is superior to JS. In reality both have their long history and warts. JS/V8 is just much faster. I never said anything about being better or worse, just that as far as i know there's n…

> Like what? None of the ones i know of meet the "expressive, flexible and easy to learn as python" test.

Kotlin is IMHO the best of the bunch, but Groovy might be the most similar to Python.

> I'm arguing that there are no languages which are faster, and don't give up some of the things that made python popular in the first place.

Python has some advantages for scripting - it's almost ubiquitous on Linux distros. But for application development, I don't think it's better than other platforms.

Re: Ask HN: Why did Python win?

#796
Ruby seems like it has Perl influence. It's something hackers might like, people who want to explore the possibilities of ideas and abstractions.

Python spells out everything, it's all explicit, they don't have 5 ways to do the same thing. They try to have one and only one obvious way to do everything.

It's a great language for programming as a means to an end. If you are writing code to make software, the same way and artist grinds pigment to make a picture, you don't want anything interesting, clever, implicit, etc.

The software is supposed to be interesting, the code is supposed to be an implementation detail that doesn't really matter as long as the tests pass and it's not actually bad code that makes people sad to work with.

My guess is that kind of thing builds momentum. Corporations use it. Educators use it. So other corporations and other educators use it.

If you start out slightly more hacker oriented, you get more of a reputation of being in the same category of Perl, and your thing doesn't feel like the bog standard boring thing as obvious as 8 bit bytes.

And people who want that stay away, and the ecosystems separate themselves out by purpose.

Re: Ask HN: Why did Python win?

#797
post #746

Earlier quoted context omitted.

>There are several languages on the JVM which are that or better. As fast as C, no... Like what? None of the ones i know of meet the "expressive, flexible and easy to learn as python" test. > There's this myth that Python as a language is superior to JS. In reality both have their long history and warts. JS/V8 is just much faster. I never said anything about being better or worse, just that as far as i know there's n…

> Like what? None of the ones i know of meet the "expressive, flexible and easy to learn as python" test. Kotlin is IMHO the best of the bunch, but Groovy might be the most similar to Python. > I'm arguing that there are no languages which are faster, and don't give up some of the things that made python popular in the first place. Python has some advantages for scripting - it's almost ubiquitous on Linux distros. Bu…

>> I'm not arguing that python is the best thing to use for everything

> I don't think it's better than other platforms

I think we're done here.

Re: Ask HN: Why did Python win?

#798
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'm genuinely curious: what's "cringe" about MINASWAN? (I write mostly Python these days, but have been involved in both communities for a long time, and MINASWAN never particularly stood out to me other than as a cute reminder to be nice.)

There is no problem with someone being nice. It's only a problem when they want you to be nice exactly like them.

Re: Ask HN: Why did Python win?

#799
post #426

Earlier quoted context omitted.

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

> 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. Maybe I'm reading it wrong, but it reads that you have been accustomed to implicit nil type conversions in other languages and that tripped you up when Go required you to be explicit. It seems Go is the explicit one here. > A library developer mi…

[deleted]

Re: Ask HN: Why did Python win?

#800

Earlier quoted context omitted.

The amount of complexity that Rust adds is not worth in most scenarios in my opinion. I can think of Rust as something for OS with critical safety or so. Besides that, in real life you end up having C in most of your software, so I am not sure how Rust behaves compared to well-written C++ with all warnings and linters on and using smart pointers. But my hypothesis is that they do not stay very far apart in safety. Th…

> The amount of complexity that Rust adds is not worth in most scenarios in my opinion. I can think of Rust as something for OS with critical safety or so. It's difficult to have this discussion in any sane way when Rust (or C) comes up. I tried Rust, but I have projects to deliver on strict timelines and I have yet to find a client who is prepared to pay me for the (what I found to be) very large onramp time to gain…

What makes you choose Go over C#/Java for medium projects? And why not go for the large projects?
Post reply on HN