5 ms·
Python grew out of a myriad of applications that built on hard to replicate components, while Ruby relied only on web development which is remarkably subject to
by huevosabio 3y ago
Python grew out of a myriad of applications that built on hard to replicate components, while Ruby relied only on web development which is remarkably subject to fashion.
Python is very simple making it easy to learn. Thus, it became more and more popular for fields where programming is not the main task, like science. It is also very easy to extend with C. So, these fields could bolt on time-tested scientific code into their Python scripts.
Ruby seemed to be entirely tied to Rails.
When the 00s and 2010s came with needs for web development and scientific computing for big applications (e.g. ads on social media), there were multiple language options for web development but really only one that made it easy to onboard academics into the task of building software systems.
From there, it was just a feedback loop, and when deep learning became a major field, the ML community was already knees deep in Python, so it was hard to justify making tools elsewhere.
Meanwhile, it seems to me, that Rail's appeal (and with it, Ruby) was taken by Node's promise of using the same language on both server and client, and more generally diluted by the fashion waves of web dev.
If you want to swap Python for another language in scientific computing, you will soon find annoyances that certain packages are missing, or don't talk to each other well, or aren't optimized. If you want to swap Ruby for another language, you just use the other language web dev library and that's it.
As an aside, Julia has been the promised replacement for Python for over a decade. It tries and does replicate the package ecosystem, the ease of use, extendibility, etc. It also goes out of its way to be able to use Python packages out of the box. But it just seems to be very hard to convince practitioners to go to Julia for just some small performance changes.
- smashed 3y agoI agree. I've seen Python being taught in Physics and hard science university cursus as an introduction to programming 15+ years ago.
- pjmlp 3y agoWhen I was at CERN in 2003 - 2004, it was when the first set of Python introductory courses started. The build infrastructure for ATLAS used the CMT tooling, written in Python. The Summer School of Computing 2004 had several sessions related to Python in the context of grid computing.
- MatthiasPortzel 3y ago> Ruby seemed to be entirely tied to Rails. I’d be interested in going one step further and asking why that was. Rails is great, but so is Ruby, but normally a great library like Rails helps attract developers to the language. Rails is the only example I can think of where a widely popular library (ostensibly) leads to fewer users of the language for other purposes.
- dizhn 3y agoNot exactly the same thing but flutter and dart have a similarly weird relationship too.
- EamonnMR 3y agoI wonder if it's because Rails creates such a specific set of expectations that when you actually try to do something without it you run into problems. "Oh, that's only a rails thing? I thought that was a ruby thing..." Ruby's monkey patching convention might make this worse.
- sensanaty 3y agoI actually failed a technical interview relatively recently because of this. It was a fullstack position with some Ruby scripts here and there mostly centered around scheduling. Had a leetcode style takehome that requested I build out a pretty simple reservation system with time off and quarter hours and stuff like that. I boot up into the leetcode environment and was surprised at just how many things were Rails-specific, rather than being in the ruby STD lib. Completely threw me off since I suddenly had to figure out how to wrestle the Date STD lib to work for me, and anything date/time related is my personal hell :)
- paulddraper 3y ago> Ruby relied only on web development Chef, Puppet, Vagrant, Logstash, etc are not web development. Ruby dominated (dominates?) DevOps tooling.
- tiberious726 3y agoBack in 2012 there was no question that ruby was the language of DevOps, then Ansible took over. Puppet was a true pain to work with, and through at least version 4, their language designers were simply wrong about what it meant to be a declarative language (you could only declare each resource once, they pretended/falsely believed that inference and/or unification were incompatible with declarative languages), but wow was it powerful to maintain dependable state on long lived servers
- gaganyaan 3y agoI think their comment still holds. Those are all tools that you use, and mostly don't care what language they're written in. When you've got to write Ruby, it was predominantly in the context of RoR. I think also that dominance has mostly faded. When I think of languages that dominate devops now, I think of Go, and I say that as someone that dislikes Go.
- JAlexoid 3y agoI'm sorry, but for me it seems that Go has is taking the lead in adoption rates for devops tooling. Ruby isn't the go-to language there anymore... probably because GoLang compiles statically.
- adw 3y agoThe k8s world is Go Central, so that probably has a lot to do with it.
- EamonnMR 3y agoYMMV, but I've only seen Rails fans use any of those.
- 3y ago
- jemmyw 3y ago> Python is very simple making it easy to learn. I would argue that there's little difference between them in ease of learning. I personally found Ruby easier because everything being an object with methods and no free floating functions felt more natural and easier to look up. i.e. string.length over Python len(string)
- ptx 3y agoIt's easier than Java, though, where you have string.length(), array.length and list.size(). In Python it's always len(whatever). But maybe Ruby wins this one if it's consistent in its method naming.
- jwells89 3y agoThe global functions throw me off too. To me in general Ruby is the nicer feeling of the two, just generally more "friendly" and "human". Whether those are desirable traits of a language is up for debate but I think there could stand to be more language with such a flavor.
- Daishiman 3y agoRuby has implicit imports which pollute namespaces. This is extremely annoying for anyone who wants to learn the language. It uses extensive monkey patching, which is once again a substantial challenge for a beginner that wants to understand what their code is doing. It has a nicer syntax with procs and lambdas but syntactically distinguishes between them with different ways of invoking functions and all the issues associated with bindings. In Python all functions look and behave the same, to the point where methods have an explicit self argument to make it clear that they're just regular functions (the semantics for function binding could be easier but then again such is the case in all object oriented languages). Python's challenges are superficial syntax; the semantics are extremely uniform everywhere and don't suffer from special cases galore.
- jemmyw 3y agoI don't think either of those issues, namespaces and monkey patching, are things that make the language harder to learn. You require a file, the file's namespaces are available. How often do libraries modify your runtime with monkey patches in a way that you'd notice? I'm sure it's come up during my career, but not when I was a beginner. There was a period of time when metaprogramming was more popular in the ruby and rails community but that was some time ago. Still, it's a tool that's nice to have available.