14 ms·
Python ended up 'specializing' in data contexts, thanks to Numpy / Pandas, and as a result, ended up becoming the first exposure to programming than anyone doin
by r_thambapillai 3y ago
Python ended up 'specializing' in data contexts, thanks to Numpy / Pandas, and as a result, ended up becoming the first exposure to programming than anyone doing data stuff had. That was millions of people. In that space, it had no competitors.
Ruby ended up 'specializing' in web dev, because of Rails. But when Node and React came out, Ruby on Rails had to compete with Nodejs + React / MERN as a way of building a web app. Since people first learning programming to build a web app would usually start with javascript anyway (since a lot of very first projects might not even need a backend), it was a lot easier for the Nodejs/React route to become the default path. Whereas if you were a data scientist, you started on python, and as you got better, you basically just kept using python.
- usgroup 3y agoPython doesn’t compare to R for analytical work — it doesn’t have the eco-system and R is specialised for it. Where Python broke in was machine learning which is not analytical work and often involves lots of general purpose programming. sklearn, skimage, opencv, Tensorflow, Torch, JAX, and so on are often used in a general code base. Torch was actually a C++/Lua framework initially before switching to C++/Python. Python has a dominant general purpose eco-system. It’s also a simple language to learn compared to R/Matlab/etc which are just horrible to use for data structures or paradigms other than vector/matrix based pipelines.
- paulddraper 3y ago> In that space, it had no competitors. Well, there's R. But basically, yes that's the long and short of it.
- jacurtis 3y agoOr Julia, a language custom designed for data science. Also, MatLab was the go-to before Python took over the scene. So it definetely has competitors. Python's strength is that it is the "jack of all trades" language. Its not the best at anything but its pretty good at everything.
- webel0 3y agoJulia is much younger. Matlab is closed source. I haven’t touched it since I had a uni license.
- masklinn 3y ago> Python ended up 'specializing' in data contexts, thanks to Numpy / Pandas Yeah it was a success 20 years in the making, had a fair amount of input from science men and that being GvR’s background he responded positively e.g. the extended slices (striding) and ability to index with an unparenthesised tuple (multidimensional indexing) were very much added for the convenience of numpy’s ancestors. I would not say it had no competition, Perl used to be quite popular in at least some sci-comp fields (I want to say bioinformatics but I’m probably wrong).
- cutler 3y agoWhy probably wrong? Bioperl was very big in the bioinformatics world.
- masklinn 3y ago> Why probably wrong? Because I don’t have a great memory and I was never into Perl so I was extremely unsure of the suggestion and didn’t want it to come across as an assertion.
- cutler 3y agoJames Tisdall and O'Reilly produced "Beginning Perl for Bioinformatics" which sold like hotcakes at Perl conferences.
- inasio 3y agoMaybe it all came down to the decision to fuse python's Numeric and Numarray libraries into Numpy, providing a unified "fast" Matlab-like library, which ended up being a great fit to a lot of datascience use cases.
- qsort 3y agoNumpy is certainly amazing, but there are tons of competitors in the data/scientific space, which pure "A-type" data scientists tend to prefer: R, SSPS, Matlab... The difference is that Python doesn't entirely suck as a general-purpose language. Sure, you might have better options, but it's still reasonable to write almost anything in Python. Other scripting languages like Ruby, JS and Lua are probably a little bit better when evaluated strictly on their merits as programming languages, but they lack the ecosystem. In other words, it might be inelegant, slow, a mess, whatever, but the concept behind it is basically correct.
- TuringNYC 3y ago>> R, SSPS, Matlab... I'd immediately throw out "competitors" that cost hundreds of dollars to use. https://www.mathworks.com/pricing-licensing.html https://www.mathworks.com/pricing-licensing.html Academic pricing is $275/yr and normal is almost a thousand a year. Then you pay for modules on top.
- ImaCake 3y agoYes, and this is why R has become so dominant in the data and statistics spaces. R is free, and has gained so much momentum that it often has packages that no other language has. Yesterday I found out that there was just no way to easily reproduce mgcv::gam in python. There are loads of similar examples. As someone who likes both R and Python, and had the misfortune to learn Stata; I am very glad to see R winning over these expensive dinosaurs. Maybe one day it will even displace matlab!
- a_bonobo 3y agoR even has packages to read in NanoSIMS data! [1] There are perhaps a hundred NanoSIMS machines in the world as they're extremely expensive [2]. Yet we have an R package on CRAN to analyse their data! [1] https://cran.r-project.org/web/packages/lans2r/vignettes/lans2r.html https://cran.r-project.org/web/packages/lans2r/vignettes/lan... [2] This 2017 reviews says there are 42 machines: https://www.osti.gov/servlets/purl/1398172 https://www.osti.gov/servlets/purl/1398172
- dmazzoni 3y agoI think Python was popular as a general-purpose language first. After all, there was a reason people put so much effort into writing Numpy in the first place. I think a lot of people were attracted to the language design, as captured in the Zen of Python (https://peps.python.org/pep-0020/ https://peps.python.org/pep-0020/), such as: Explicit is better than implicit. Readability counts. Errors should never pass silently (unless explicitly silenced) There should be one-- and preferably only one --obvious way to do it. In many cases, Ruby has almost the opposite philosophy. There's nothing wrong with that - but I think a lot of people prefer Python's choices.
- Loeffelmann 3y ago> There should be one-- and preferably only one --obvious way to do it. This is so hilariously wrong in python though
- isitmadeofglass 3y ago[dead]
- EdwardDiego 3y agoWhatever in the NamedTuples do you mean?
- KptMarchewa 3y agoThere is also TypedDict, Pydantic, Attrs and dataclasses
- EdwardDiego 3y agoYep, but couldn't be bothered typing them all :D
- thesuperbigfrog 3y agoAs evidenced by the unified Python library / dependency management system.
- dgellow 3y agoTo add to your comment, the web space was also already very crowded, with PHP, C#/ASP, whatever Java people were using, Django, etc. Rails has always been fairly niche compared to giants like PHP.
- rcarmo 3y agoPeople like to hate on PHP (and to be honest I really never enjoyed it), but there was a time when if you wanted to build powerful, large scale websites (or hosting, or scalable web farm deployments) it was the most reliable and performant thing short of Java. It also helped that the PHP ecosystem had some pretty solid and battle tested HTTP components and pretty productive frameworks--server-side rendering with Varnish was as fast as a CDN-backed site feels today.
- CuriouslyC 3y agoThe things PHP had that made it win (for a while) was that it was easy to set up and configure for a hosting environment (Apache plus modphp worked out of the box consistently) and the HTML first design made it easy to add to static web pages, whereas forms and CGI was multiple steps and more confusing for less experienced devs.
- cutler 3y agoI'd qualify that. A lot of the hype around PHP being easy for cheap web hosting misses the point that a lot of that cheap hosting was configured with PHP as a CGI module, not mod_php. In that sense it was on a level playing field with Perl.
- KingMob 3y agoAgreed. The one thing PHP demonstrably did better than other langs (other than be a simpler Perl) was be web-first. Other langs assume you could be doing anything, and here's the extra steps necessary to make it serve pages. PHP assumes the reverse.
- rcarmo 3y agoThere is a lot more history before the data part. But yes, it is a big "modern" driver for its popularity, and Python owes it to its easy C interop. I would contest the Ruby as web dev part, though. I used Ruby for Puppet and Vagrant a long time ago and it was great, but all my experiences with Rails (and associated gems) turned into maintenance nightmares.
- kevinlu1248 3y agoMight be wrong but I think it started with Jupyter/MatplotLib + Python's permissive license. Heard it started all with a physics professor unable to use Matlab for teaching.
- thewataccount 3y agoI'll argue that python is very alive in the system management/scripting space. Because of the library support (especially for data) it's also popular as api servers. It's not as popular for entire applications but is still very active. EDIT: Django is actually about equal or more popular then nodejs based on google trends. Not sure that means anything as idk how many people google "nodejs" when working on it.
- cutler 3y agoI think HTMX has given a new lease of life to old school, server-side frameworks like Django and Flask.
- seydor 3y agoThat was Matlab. Python was the substitute
- mattferderer 3y agoI think that data science & web competition is at least 80% but I'm going to throw out a few possible ideas that I haven't seen mentioned that may have helped. Maybe I'm way off base though. * Udacity's popularity. It's first few free courses were Python. I believe they advertised as a way to get into Google. Not sure how many people got into Google via Udacity though. * Leet Code Job Interviews. Maybe I'm way off here as I don't do these but from what I've read people who spend a lot of time on these prefer Python because the syntax & libraries often give a speed & simplicity advantage. * Lots of devs had to install Python to use some utility or tool someone else created.
- gilcot 3y agoGood points.
- twelvechairs 3y agoI agree with these as major points. A few other secondary ones Ruby was primarily maintained in Japanese, so had a barrier to entry for language level issues. It also lacked english-language evangelists and university presence. When Ruby was new (invented 1995) Python had some older design issues (as it was 6 years older) however it really recovered and implemented a lot of change through Python 2 (2000) and python 3 (2008). Though there were compatability issues in the short term in the long term this change worked out. Ruby inherited from perl TIMTOWTDI (there is more than one way to do it) philosophy which is a little more at odds with the scientific community
- hnfong 3y ago> Ruby inherited from perl TIMTOWTDI (there is more than one way to do it) philosophy which is a little more at odds with the scientific community It's at odds with humanity, TBH. I once spent like two days trying to figure out how a small (couple hundred lines) ruby script worked, because it overrided `method_missing`.
- dgellow 3y agoWasn’t python released in 1991? That would make it 4 years old when ruby is released.
- fiddlerwoaroof 3y agoAs a Python programmer in the 2.x days, I think data science happened fortuitously to counteract the exodus over the 2->3 transition. For a long time, it felt to me like python was on the way out because of the changes.
- mr_toad 3y agoAt the same time a lot of undergrad programmers were being introduced to Python 3. I think that’s probably the single biggest factor in the Pythons success.
- eddy_chan 3y agoToday I learnt I'm fucking old. My first web programming exposure was Perl CGI scripts
- kstrauser 3y agoThis fine day, we are all old together.
- latchkey 3y ago#metoo, 1993.
- cutler 3y agoThe Mouse Book (https://www.oreilly.com/library/view/cgi-programming-with/1565924193/ https://www.oreilly.com/library/view/cgi-programming-with/15...), by any chance?
- deafpolygon 3y agoMe too.. learned it in college.. use CGI; It was fun.
- forrestthewoods 3y agoGood answer. Python is, imho, not a very good language. But it has a few great libraries which led to overwhelming momentum and inertia. In a cruel twist of irony those libraries are probably written in C.
- gabereiser 3y agoBingo! Then you have 2-3 year experience junior devs join your company because they know react and are completely blank stare faced when you ask them how they are serving their data.
- nonameiguess 3y agoThis is part of it, but the reasons go back further. As others have mentioned, Python is a pretty old language. It debuted as "Python" in 1991 even before Linux was out, and it existed as ABC even in the late 80s. It had a very good, easy to use C API early on. Combining that with the way it can load shared object files as modules and the ability to create user-defined operators and effectively extend the default syntax allowed it to mimic both MATLAB with SciPy and Numpy and R's data.frame with pandas, which is a huge part of why it attracted all the people from scientific computing and data analytics. The API to the major packages was nearly identical to what they were already familiar with from before. It's not an array language on its own, but the ability redefine operators and the fact that array indexing is itself an operator made it possible to turn it into an array language. The fact that all of these packages can easily just wrap existing BLAS and LAPACK implementations made it very fast for these purposes, too. That also happened pretty early. Numpy came out in the 90s. But even before that, Python and Perl were about the only two scripting languages other than the shell that was guaranteed to be present on a GNU/Linux system from the start. That made it really popular to create high-level system utilities in Python. A whole lot of the util-linux packages, libvirt, the apt packaging system, all make heavy use of Python. So it's not just the academics already familiar with it, but system administrators and hackers, too. It also gained widespread popularity as a teaching language alternative to Java. Once MIT started using it in their intro to programming course and put that on the Internet via OCW, it really took off as many people's first exposure to programming. The batteries included approach to the standard library makes it very usable for one-off automation tasks, too. I don't even like Python that much, but the other day I was doing some math work and just needed to compute a bunch of binomials and enumerate subset combinations. You want to look up how to do that in your language of choice? Python just has math.factorial and itertools.combinations in the standard library. If you're using Linux or Mac, you already have it. It may not be a great choice for application development, but if you need to do some quick, interactive tasks that are never going to get deployed or even necessarily stored on disk as files but just run once from the repl, and it's too much for your calculator app or Excel to handle, Python is perfect.
- mgl 3y agoBut still slower and more energy consuming than Javascript or Java unless you use it like a wrapper of C/C++ libraries: https://stratoflow.com/efficient-and-environment-friendly-programming-languages/ https://stratoflow.com/efficient-and-environment-friendly-pr...
- PaulHoule 3y agoPython also had a near death experience with the Python 2 to Python 3 transition, it could have wound up like Perl did with Perl 6 but I think the data science use case really made it. Overall I think Python is the best language for the non-professional programmer who wants to script things and put their skills on wheels.
- AlphaSite 3y agoIt’s not because of data science, it’s popular for the same reason Java is popular, it’s what they teach in schools. It’s a virtuous cycle, industry adoption grows school adoption which grows industry adoption…
- Macha 3y agoBeing taught in schools is helpful, but not sufficient on its own, or we'd see more professional Forth, Prolog and Scheme programmers
- albert_e 3y agofuture headlines: Scratch for Cancer Diagnosis. NASA adopts no-code GenAI interface for critical navigation and telemetry on first human flight to Mars.
- rcpt 3y agoAnd this was all despite Python 3 which was, imo, the worst software migration in history
- mrweasel 3y agoThe worst one that succeeded.
- __loam 3y agoRuby is also kind of horrible.
- embit 3y agoIt is easy to underestimate how much Python as a language benefited from nympy, scipy, pandas and scikit-learn
- asu_thomas 3y agoNumpy and Pandas existed as they did because Python is written in C and cooperates so well with C, so I believe that would be the better answer.
- williamsmj 3y agoI think you're describing a symptom (popularity in data contexts) rather than a cause. If you're looking for causes, https://jeffknupp.com/blog/2017/09/15/python-is-the-fastest-growing-programming-language-due-to-a-feature-youve-never-heard-of/ https://jeffknupp.com/blog/2017/09/15/python-is-the-fastest-... makes a good case the answer is PEP 3118.
- n_ary 3y agoNot only math/academia, but nearly everywhere. As python started coming pre-installed on MacOS and was a lot easier than fumbling with shell scripts, a lot of scripts were being written to automate boring stuff. Also, the hidden beast is Django and Flask, which are also being commonly used by both serious and non-serious folks, overall increasing the userbase. Also python is less verbose(compared to Java, C#, Scala, JavaScript pre-ES6 etc.) in terms of syntax, so it is much easier to learn and can do both OOP and Functional, while being easier to adapt(no compiler, easy installation, lots of popular libraries), hence academia picked it up. Also, python has built-in parallel processing features which are less daunting(in terms of concepts and syntax) than other competitors(C++/Java etc). See the popularity of Go, same thing happened with Python.
- fulafel 3y ago> Python ended up 'specializing' in data contexts There's a big sub-continent of data stuff in the Python ecosystem, but Python the language hasn't specialized there I'd argue - it has enabled the 3rd party number crunching and data libraries like NumPy and Pandas, but not specialized over other domains where Python is used.
- skenderbeu 3y agoPython specialized in ease of learning and running the code. Everything else came after as a byproduct of the large user base. One reason why I switched our team from Matlab to Python was the capabilities of the core libraries. Argparse alone sold it for us.
- PurpleRamen 3y agoThat's a fascinating wrong way to look at history. Python has no specializing. It always played strong on many popular fields. From the early days, it had a strong leaning to science, after all that's where it came from. But at the same time it also had a strong stance in unix-areas and established itself as a good tool for sysadmins, competing with perl and bash. And at the same time it also had strong bindings with other languages, gave it early on the fame of a glue-language. It also dabbled early in Web-Stack and networks and had to many web-stack-option to gain that "one framework"-fame, like ruby on rails. Python just was the language which allowed you to play on on all the important fields, with simplicity, even with some level of speed. This was something other languages lacked. They either were complicated, or slow, or lacking support for specific areas. Python just somehow acquired them all, and had a big impact on a broad area, which made it so popular, because for the majority of usecases it was a natural option.
- zeku 3y agoIt actually does have a competitor, R. R has a superior ecosystem for quite a few data tasks. Mainly in the analysis/statistics space. However aside from that R is vastly inferior.