3 ms·
I don’t have a ton of love for Python now that I’ve moved on to static typing but it’s hard for me to see myself choosing Ruby over Python for anything. Python
by skrtskrt 4y ago
I don’t have a ton of love for Python now that I’ve moved on to static typing but it’s hard for me to see myself choosing Ruby over Python for anything.
Python has gotten significantly faster, has static typing built in with an ecosystem of static typecheckers, and async is an ergonomic first class language feature - sure async can have rough edges but the 99.9% case is dead simple with no surprises.
Obviously packaging for Python is still a pain but I don’t see Ruby being better
- foxandmouse 4y agoI've only ever known Javascript/ Typescript. I've been thinking of picking up ruby to learn "practical" functional programming and maybe see what the infatuation with rails is, but I'm starting to think it might be more "valuable" to learn python.
- skrtskrt 4y agoPython and Ruby are both only really as functional as you choose to use them. You’ll see more imperative code in the wild for both, though the big data stuff in Python leans more functional. Rails and Django are both still super popular from scanning job listings, so e-commerce employment wise they’re both great. FastAPI is also growing a lot. Big Data leans heavily Python
- sodapopcan 4y agoI wouldn’t recommend python or ruby if you’re trying to learn more about functional programming… you may as well stick with JS in that case (imo, at least). I’d choose a language that has at least had native immutability. Something like Elixir/Erlang, OCaml, Clojure, or F#.
- skrtskrt 4y agoI’m seeing a pretty significant amount of Elixir job listings these days even in areas where you used to see all Ruby or Python
- sodapopcan 4y agoI've actually been having a tough time finding another job in Elixir. Sooooo many companies who use it are in crypto and I just have no interest.
- freedomben 4y agoPurely my opinion after learning and professionally doing both Ruby and Python. If elegance and consistency in APIs matter, Ruby is by far the preference. Generally speaking (again from my own experience which should be taken with a grain of salt) the Ruby community tends to value readability/maintainability of code a lot higher, so working in the codebases is typically a lot more pleasant. IIWM I'd go with Ruby hands down.
- satvikpendem 4y agoIf you already know TypeScript, just use a functional approach to your programs, and/or use libraries like fp-ts and io-ts. Ruby is definitely not more FP based than TS.
- harshreality 4y agoPython would be the most popular option, but, for an OO language, Ruby feels clean and intuitive to me in a way that other languages, especially Python, don't. It has a performance cost, though. The two languages' performance may be roughly equivalent, but Python has more native-code libraries for performance-critical tasks. You don't see many ML projects in Ruby. :) There's crystal-lang, but that has a much smaller community behind it. Julia, though, if you're looking for a language that isn't OO in addition to functional.
- bhaak 4y ago> Python has gotten significantly faster All the synthetic benchmarks I've seen claim that Ruby is at least on par with Python's speed if not faster. Like this https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/ruby-python3.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... But then speed in a dynamic language is often very context dependent. If I want to do Rails I won't choose Python. If I want to do machine learning, Python is the obvious choice. > Obviously packaging for Python is still a pain but I don’t see Ruby being better Ruby packaging just works whereas Python's is a pain. Can't see how you don't see it being better.
- skrtskrt 4y agoThose benchmarks are with Python 3.10 - the big recent speedups are in 3.11, with more to come > The Python 3.11 release announcement cites 10~60% improvements over Python 3.10 and a 1.22x speed-up for its standard benchmark suite.
- igouy 4y agofyi now Python 3.11.1 https://benchmarksgame-team.pages.debian.net/benchmarksgame/measurements/python3.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- lraktr 4y agoYeah, the Debian benchmarks are independent. The recent Python benchmarks all seem to use the same benchmark suite (which is incredibly complex to the point that it's unclear what is actually being measured) or hype the Microsoft involvement. Even if you believe them, it is just 10-60% speedup for a very slow language. It won't show up in web applications.
- chucke 4y agoPython improvements are on par with ruby, and ruby has a JIT, which means that upside fir real world improvement is much higher. Python has no static typing. It has type annotations, which a few 3rd party static analysers such as mypy use. Ruby has had the same since 3.0 with rbs. The ecosystem may be less mature, but it exists, and Python's isn't necessarily perfect. Python async is terrible. You have to colorize functions, opt out from a significant part of the ecosystem which either does not support async, or is very unstable, and completely relearn how to do debugging / performance measurement. Ruby has smth better since ruby 3.0, via the fiber scheduler, which supports running network related code asynchronously with *no changes or special function annotations*. Ruby packaging has been figured out since 2007, and has been influencial for other ecosystems, being the first mainstream language adopting lockfiles. If you prefer using Python, you are entitled to your opinion and choice. But those arguments are all FUD.
- joshspankit 4y ago> it’s hard for me to see myself choosing Python over Ruby for anything. Did you mean this the other way around?
- skrtskrt 4y agoyep fixed