Ask HN: Why did Python win?
711–720 of 856 posts
Re: Ask HN: Why did Python win?
#712Earlier quoted context omitted.
That was my experience. I like Perl. I'm comfortable with Perl. And after about a day of Python, I never wrote another line of new Perl code. There were so many "it can't possibly be that easy, but it is!" moments. Let's write a function to add five to a number: def add_five(num): return num + 5 OK. So, can I pass that function as an argument to another function? def call(func, value): return func(value) call(add_fiv…
If that blew you away you really should try Ruby: def call(fn, val) = fn.(val) call(->(n){ n + 5 }, 10)
Ruby on the other hand encouraged cleverness like what you wrote.
I think ruby faded for the same reason perl did. It is cool to write code, but once it's time to maintain it, especially after the rock star who wrote it left, it sucks.
Re: Ask HN: Why did Python win?
#713So it grew a critical mass of people who know Python but not for the sake of Python itself, but for something else. And suddenly these people are invested. They want more, better, and faster. And then the demand pulls the proposition, and a decade later, Python is a big thing.
I work in applied geometry. Numpy is good. Pandas is of little relevance for what I do. But what became a gamechanger is Numba. It's a run-time compiler that brings Python into native code for the target architecture, Inter, ARM, or even NVidia GPGPU.
We used to do research in Python, invent algorithms there, and then rewrite them in C++ "for performance". The last time we did that, C++ version became 3 times as slow as the Python one when translated literally. We hid the fact by rewriting the algorithm itself, but that was the last straw. We now run Python in the cloud directly, and it rebuilds the native code for every piece of hardware we procure for the task automatically and I think this is beautiful.
Re: Ask HN: Why did Python win?
#714Earlier quoted context omitted.
I would just add that for scientific scripting Julia is usually nicer to program in than the combo of numpy and Python. Julia is fast enough on its own that you can do the matrix calculations directly and it supports real mathematic matrix operators. It’s also a great type based design that makes using packages magical.
I think Julia has a hard uphill battle against the "Python is the second best language for anything" effect. Julia looks pretty cool to me, but I already know Python. I'll probably learn more about it in my spare time, but I'm also never going to be able to convince my coworkers to try it out, because they also know Python and that's good enough for them. And thus Python's dominance continues.
The problem in using two languages is that you do not have just to learn a new language besides Python. You have also to figure out how to properly interface them. (f2py was considered the easiest solution, but we feared that the 1- vs 0-based array indexing would have likely caused many bugs.)
Re: Ask HN: Why did Python win?
#715[flagged]
Honestly, your critiques seem more like opinions. The comments are pretty spot on that these are not issues. Your perspective on the default data types is off though. This is not an attack. I simply disagree with you descriptions and opinions.
Re: Ask HN: Why did Python win?
#716Earlier 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…
I think Python has some of the worst API documentation I’ve ever read. Even Java puts it to shame and that is sad
Re: Ask HN: Why did Python win?
#717Earlier quoted context omitted.
A lot of Rubyists are turned off by Python because there are just too many ugly things and exceptions in Python.
100% fair. They're probably right; certainly right from their own subjective view, which is what matters. I'll also note that the OP focused on how "fun" Ruby was. Ruby is beautiful and fun. Going back to the original question: why did Python grow more than Ruby? My first answer was going to be a rhetorical question: which beautiful and fun language has been the most successful? C isn't especially beautiful or fun, n…
Ruby’s beginner-friendliness and consistent OO design managed to help it expand in the early aughts and Rails brought the language to prominence in 2005, but by that time Python was already replacing Perl in its niche and had support from giants like Google.
Ruby got more adoption than would have been predicted based on its late entrance and lack of truly differentiating features, and that’s a credit to its ergonomics, community and how easy it is to learn.
Re: Ask HN: Why did Python win?
#718Earlier quoted context omitted.
But it is absolutely unintuitive why it shouldn't be if mylist.length > 10
If the length of mylist ... see how length comes first? Only unintuitive if you never spoke English or other european languages.
As a native speaker of English, I’d just say, “if mylist’s length is more than 10”.
Re: Ask HN: Why did Python win?
#719[flagged]
Re: Ask HN: Why did Python win?
#720Earlier 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 just wish Python applied this approach to package management. It is needlessly complicated.