Live data from Hacker News

Ask HN: Why did Python win?

news.ycombinator.com

381–390 of 856 posts

Re: Ask HN: Why did Python win?

#382
post #224

Earlier quoted context omitted.

R is great when your data is already together in one place and homogenous/processed. In that instance the workflow using dplyr/ggplot is better. R the language is hot garbage though, and the libraries available for doing random things that aren't working with certain data structures, doing math or plotting are generally much worse than their python equivalents. That is the reason python dominates data engineering, an…

R will still have a solid place in industrial pharma for a long time (even as python growths, R growth will continue. R is pretty tightly intertwined with the process of processing and submitting data from clinical trials to the FDA, much to SAS's chagrin. Personally I think we have to accept that R, Python, Java, C++, and Go are going to be with us for the rest of our lives. I would expect PHP, Ruby, and Perl to go…

Rails is probably going to keep Ruby relevant for a lot longer than Perl. I might go as far as to predict that Ruby will be the new COBOL or FORTRAN - widely used but neither cheap nor easy to find someone to modify it.

Re: Ask HN: Why did Python win?

#383

Earlier quoted context omitted.

Python may be JIT now (is it?), but it certainly wasn’t back then.

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 compiles to bytecode transparently, but does not do any JIT compilation to native, which is part of the reason it's considered a "slow language" (though this expression doesn't really make any sense, as slowness is a property of the implementation, not of the language).

TLDR:

Java uses AOT bytecode compilation + JIT compilation

Python uses import-time bytecode compilation + slow interpreter

Re: Ask HN: Why did Python win?

#384
post #229

Earlier quoted context omitted.

>New users wonder how to call functions. They form an intuition ("use parenthesis"), but it's unreliable. "Oh, parenthesis are optional--oh, parenthesis are only optional sometimes". print f"are you {sure} you need parenthesis to call a function in python" >Python is much more boring in this respect, users are more likely to form accurate intuitions. is defining a class the same as defining a function? What about fun…

> print f"are you {sure} you need parenthesis to call a function in python" This example doesn't call any functions. The print statement was removed in Python 3 and turned into a function, so you do need parentheses to call it and the example above is a syntax error. Python 2 (which had a print statement instead of a print function) didn't support f-strings. And f-strings, unlike JavaScript's template strings, are no…

> And f-strings, unlike JavaScript's template strings, are not function calls.

IIRC, they're syntactic sugar over "string".format(locals())

Re: Ask HN: Why did Python win?

#385
Ruby became popular in the web dev space only, because of the frontend stuff and RoR. When node appeared Ruby became almost deprecated.

Python is not great at anything really, Numpy is good because uses C code, PIP is crap, the stdlib has 0 consistancy, types are comments, you have to learn venv, etc... But Python is everywhere, it is in the web dev, devops, data. And now is even in the browser, Excel, rpi, etc... so learning python means you can do anything anywhere.

Re: Ask HN: Why did Python win?

#386

Perl5 was king in the 90s and early 2000s for building web apps, and as Perl5 faded, Python was the obvious contender and it took over. Perl5 was built more for CLI programs and text processing tasks, like Awk. As the internet got bigger, Perl5's idiosyncrasies became more evident. People wanted a cleaner and more structured language that could remain readable in large code bases. I remember building backends in the…

You want a Perl backend that is still maintained even now? Look no further.

https://github.com/nsquarednz/jarvis

Re: Ask HN: Why did Python win?

#387
post #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…

Your point about statically typed languages rings so true to me. I learned Object Oriented programming on Java, then did professional C# with ASP.NET.

I changed companies and learned Python because everyone was raving about it on the Web. I was so confused when I started using it, I thought I had a misconfigured environment or that I was missing some libraries when I started writing Python.

Re: Ask HN: Why did Python win?

#389

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…

+1 for mentioning that python's original competitor was Perl. This point is forgotten some 20-30 years latter

Re: Ask HN: Why did Python win?

#390
post #378

Earlier quoted context omitted.

Can you explain more about how (you feel) Python is a step backwards? I'm curious if the "steps backward" are syntax level? I feel the Ruby community is very syntax oriented. As evidence of this: I see Ruby developers interested in Elixir and Crystal, languages that are syntactically similar, but technically very different. I do not see Ruby developers interested in Python, even though, if we ignore syntax, Python an…

I really wanted to love Python. As a Ruby programmer I thought Python would be like Ruby, but with a prettier syntax because of the syntactic white space. Unfortunately this turned out not to be the case. Here's my gripes with Python as a Ruby developer that really wanted to love Python: There's a bunch of global functions that should have been methods on objects, like `len()`. OO in general seems slapped on later, a…

I agree with the objective observations, but subjectively I prefer Python.

Python's OO does feel slapped on. As a Python user I've come to see object-oriented code as just some syntax to organize data and functions. To me, it's all functions, always has been.

I'm curious to know if you have similar thoughts biased towards objects? Do you view functional code as just a way of creating and organizing object-like concepts? I have heard that Ruby is quite pure in its philosophy and approach to object orientation, like SmallTalk, but I don't know either language well enough to fully appreciate this way of thinking.

Post reply on HN