Live data from Hacker News

Why Python keeps growing, explained

github.blog

201–210 of 459 posts

Re: Why Python keeps growing, explained

#201
I'd been in the Python community for around 10 years, spoke at several conferences, wrote libraries; contributed to CPython, Openstack, and others. I've been a technical reviewer for a book on distributed computing in Python. A big part of my career was built on this language, its community, and ecosystem. I'd say a big part of Python's slow-and-steady success is its community. Going to Pycon US, Pycon CA, and Pycon's around the world -- the user groups that the foundation funds with Pizza money and mentorship programs: it's a fairly unique experience.

Another major factor is how it serves as a glue language in the scientific community. Python provides a relatively simple programming language that powers complex, powerful libraries like NumPy, SciPy, PyTorch, SymPy, etc. It's like a scripting language for engineering and scientific computing tools, sort of like what Javascript does for browsers, Node, and Deno, etc.

I don't do much Python programming these days but I owe it a huge debt! May it continue to flourish and grow.

Re: Why Python keeps growing, explained

#202
They don't mention that Python makes it really easy to interoperate with other languages via the subprocess module. So you can run Javascript web code via node, wait for it to finish, then move on to something else. Or you can launch a C++ process that's can do real parallelism and wait for the results, avoiding many issues with the Python GIL.

Also, Python makes it easy to work in different programming paradigms, it's as easy to write functional-type code as it is to write object-oriented code, both approaches are supported. This makes it a great prototyping system if you want to rewrite the code later in some other language like C++ to get some performance improvements.

Re: Why Python keeps growing, explained

#204
post #163

Earlier quoted context omitted.

I've rewritten real world performance critical numpy code in C and easily gotten 2-5x speedup on several occasions, without having to do anything overly clever on the C side (ie no SIMD or multiprocessing C code for example).

Did you rewrite the whole thing or just drop into C for the relevant module(s)? Because the ability to chuck some C into the performance critical sections of your code is another big plus for Python.

But... pretty much any language can interoperate with C, it's calling conventions have become the universal standard. I mean, I still remember at $previousJob when I was deprecating a C library and carefully searched for any mention of the include file... only to discover that a whole lot of Fortran code depended on the thing I was changing, and I had just broken all of it (since Fortran doesn't use include files the same way, my search for "#include Julia, to use the great-great-grand-op's example, seems to also have a reasonably easy C interop (I've never written any Julia, so I'm basing this off skimming the docs, dunno, it might actually be much more of a pain than it looks like here).

Re: Why Python keeps growing, explained

#205

I'd been in the Python community for around 10 years, spoke at several conferences, wrote libraries; contributed to CPython, Openstack, and others. I've been a technical reviewer for a book on distributed computing in Python. A big part of my career was built on this language, its community, and ecosystem. I'd say a big part of Python's slow-and-steady success is its community. Going to Pycon US, Pycon CA, and Pycon'…

The syntax, I think, is also the least likely to scare off newbie programmers. Personally, I came to really dislike the Python syntax, but it reads rather well, is very unintimidating, and easily supports the kinds of things that newbies will be doing.

Not to rag on Python, but I found the indent-sensitivity of Python can make it challenging to do the sort of basic things that C-family languages make fairly simple. Lambdas in Python suck in contrast to how lambdas and anonymous functions work in other languages.

But yeah, Python has proven itself to be a great language for a wide variety of applications. It makes a lot of sense for the scientific community probably because things like heavy object orientation matter a lot less in those cases. The community doesn't discourage people from just writing functions, unlike other communities that are hellbent in making everything a method of some class structure and being explicit about that.

Re: Why Python keeps growing, explained

#206
post #38

Earlier quoted context omitted.

> - it’s believed to be beginner friendly compared to other languages. I’m not really sure why - maybe the whitespace? I am leaning more towards it looking like pseudocode > - it has an enormous set of libraries available to use I believe that to be the actual reason. I've long held that python is a kinda bad language, but with FANTASTIC libraries

And fantastic documentation!

This is an under-discussed point, at least from my biased opinion. It seems like the Python documentation ecosystem is the best, and has been building fantastic tooling for over 10 years now.

Re: Why Python keeps growing, explained

#207

I remember when Twitter rewrote the code in Java because Ruby wasn't suited for the task. Probably this will happen to many large Python code bases in the future.

Perhaps, but it seems the shelf-life of anything AI/ML related (huge part of Python usage) is so short that it'll become obsolete before it ever becomes worth rewriting.

Re: Why Python keeps growing, explained

#208
post #62
post #35

Earlier quoted context omitted.

There's also the argument that at a certain scale the time of a developer is simply more expensive than time on a server. If I write something in C++ that does a task in 1 second and it takes me 2 days to write, and I write the same thing in Python that takes 2 seconds but I can write it in 1 day, the 1 day of extra dev time might just pay for throwing a more high performance server against it and calling it a day. A…

If Python was merely twice as slow then I could agree with you.

Not all code needs to process terabytes of data.

I have code running that reads ~20 bytes, checks the internal status on an hashmap and flips a bit.

Would it be faster in C? Of course.

Would it have taken me much longer to write to achieve absolutely no benefit? Yes.

Re: Why Python keeps growing, explained

#209
post #11

Python keeps growing in number of users because it’s easy to get started, has libraries to load basically any data, and to perform any task. It’s frequently the second best language but it’s the second best language for anything. By the time a python programmer has «graduated» to learning a second language, exponential growth has created a bunch of new python programmers, most of which don’t consider themselves progr…

I completely agree - but you say that like it's a bad thing. I work as a developer alongside data scientists, who might have strong knowledge of statistics or machine learning frameworks rather than traditional programming chops. For the most part they don't need to know about concurrency, memory efficiency etc, because they're using a library where those issues have been abstracted away. I think that's what makes py…

> a whole bunch of the footguns

Could you expand on this in the context of Rust?

Post reply on HN