News for hackers. Stuff that matters.
Re:Why Python keeps growing, explained by Akronymus on Friday March 03, 2023 @03:30AM (#35007147)
> - 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

Re:Why Python keeps growing, explained by deafpolygon on Friday March 03, 2023 @03:34AM (#35007171)
> but with FANTASTIC libraries written in C

ftfy - it's the only way a tragically slow language like Python can keep up.

Re:Why Python keeps growing, explained by dagw on Friday March 03, 2023 @03:43AM (#35007224)
libraries written in C

That is simply not true. Even libraries like numpy, scipy and scikit-learn are majority python code.

Re:Why Python keeps growing, explained by deafpolygon on Friday March 03, 2023 @03:50AM (#35007274)
Majority python code, being ~60% is mostly wrapper code, with the slowest parts (the parts that matter) written in C.

https://stackoverflow.com/questions/1825857/how-much-of-nump...

Re:Why Python keeps growing, explained by grog_tremor on Friday March 03, 2023 @03:51AM (#35007284)
Eh, you massively overestimate the importance of performance.

For the vast majority of use cases, performance just isn't a priority. Doubly so for Python, that shines for simple automation, command line applications, and perhaps some serveless computing.

Being easy to write, having a good ecosystem of libraries, and being widely known is typically good enough. I wouldn't use Python to write a robust backend server side application, mostly because the language doesn't lend itself well for it.

Re:Why Python keeps growing, explained by deafpolygon on Friday March 03, 2023 @04:06AM (#35007380)
Eh, you make incorrect assumptions about me. I'm stating a fact why Python is used - the data science ecosystem in Python thrives because of well-written libraries _written in C_ under the hood AND an easy-to-use language that writes like pseudocode.

If it was too slow, we'd be doing all of this in Java, the C# or maybe doing it in C/Fortran. But because of some early design decisions (Guido being on the matrix-sig helped), the history behind Numeric/Numarray and finally NumPy and SciPy being based on those efforts allowed it to thrive.

Re:Why Python keeps growing, explained by grog_tremor on Friday March 03, 2023 @04:30AM (#35007524)
> it's the only way a tragically slow language like Python can keep up.

Those were your words, not mine. I need not make any assumptions.

I just replied listing use cases where Python shine due to its strengths, performance being mostly irrelevant. I didn't even mention data science.

And although it's beyond the point, if I was to use Python, why should I care in which language a library was written? If the language allows libraries written in other languages, this is actually a nice feature.

Re:Why Python keeps growing, explained by UncleEntity on Friday March 03, 2023 @04:38AM (#35007579)
> If the language allows libraries written in other languages, this is actually a nice feature.

That’s actually my primary use case for python, playing with C/C++ libraries in a repl because they don’t natively have one.

Sure, it takes work to wrap a library but that’s something I enjoy doing.

Re:Why Python keeps growing, explained by mort96 on Friday March 03, 2023 @03:52AM (#35007292)
Does it matter?
Re:Why Python keeps growing, explained by UncleEntity on Friday March 03, 2023 @04:41AM (#35007596)
Because it’s proof, PROOF!!!, that python is inferior to their favorite language.

Just wait until they learn the python interpreter is written in C… <grabs popcorn>

Re:Why Python keeps growing, explained by ihatepython on Friday March 03, 2023 @03:55AM (#35007312)
Don't forget about FORTRAN
Re:Why Python keeps growing, explained by pharmakom on Friday March 03, 2023 @03:44AM (#35007234)
beginner programmers don't know pseudo code either though!

the best teaching language (imo) is one with few features or surprises. I think Scheme might come out top here.

Re:Why Python keeps growing, explained by dagw on Friday March 03, 2023 @05:31AM (#35007885)
I think Scheme might come out top here.

Depends what you are trying to teach. If you're trying to teach computer science and programming fundamentals, then sure. If you're trying to teach people how to get 'real work' done quickly and efficiently then Scheme will only get in the way and slow people down.

For example when I've taught programming, one of the tasks I taught fairly beginner programmers was to grab some satellite images between certain dates, try to detect if there is a forest fire, measure the spread of the fire and plot the spread on a map.

With python (and its excellent libraries) this is quite quick and easy, and most people are up and running and hacking around with their programs in pretty short order. They find it really cool and inspiring and makes them quickly realise that programming could be something useful in their day to day job. Trying to start with for example SICP and Scheme and working up from there to solving the above problem would probably lead to most of these people giving up on programming very quickly. That being said the few people that made it all the way through that would no doubt be much much better programmers because of it.

Re:Why Python keeps growing, explained by Izkata on Friday March 03, 2023 @08:17AM (#35009170)
> beginner programmers don't know pseudo code either though!

It looks like English. That's all pseudocode is, and they know that well enough.

Re:Why Python keeps growing, explained by mr_mitm on Friday March 03, 2023 @03:59AM (#35007342)
And fantastic documentation!
Re:Why Python keeps growing, explained by ericholscher on Friday March 03, 2023 @09:41AM (#35010174)
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.