by martingordon · 8y ago · 0 comments
In the past year or so I've done a lot of more modern JS development (with Babel and Flow) and toyed around with Elixir and ReasonML. Ruby hasn't seen much change in the past couple of years (granted it's much more mature than Elixir/Reason) and while it was a boon to developer productivity and happiness compared to the languages of the time, I think we've probably found a better balance in type systems these days than Ruby and the like did at the time.
Maybe it's just legacy codebases, but manually reasoning about types is huge time sink and are one of our leading causes of production errors. Explicit typing also informs better design (I've seen many a Ruby method have return type of `String | Array | nil`). Unit tests help, but why outsource that to tests and guard statements (where you have to check every type) when a computer can do that for you?
I'm a long time Rails dev as well. IMHO the main problem with the Ruby ecosystem is that the libraries haven't moved on into the current day and age. I find myself building more and more projects in something like Java or Python because those ecosystems have the firepower of the ML, AI, data processing libraries. And while I'd still say Rails is the best for building pure web and rest API stuff, Java and Python have gained a lot of ground and when all your real app power is in Python or Java a lot of times its not worth wrapping your core apps in another runtime just to provide a rest interface.
Any other rails / ruby devs experiencing this?
Ruby / Rails is so much more productive for me. No other language nails so many features as well as Ruby. Blocks are great, the meta-programming is natural and easy to debug, c-extensions are easy, and I generally like the balance it strikes with types. Couple quibbles here and there, to be sure, but usually the DB acts as my type enforcer and the high degree of test coverage covers the rest. Plus whenever I think something is risky I just throw in an explicit type coercion or exception, but it is rare.
I find people generally fall into one of three categories: Documentation enthusiasts, type enthusiasts, or test enthusiasts. Because I prefer human readable code I prefer meta-programming and because I prefer meta-programming I prefer tests over types or documentation. Though I don't pretend it's drawback-free, it is the environment that makes me happiest.
I think my next major thing will be to modify ruby itself because there are things that are missing that I feel could make it even better, but I'm trying to figure out if I can get away with just doing it in a really powerful gem.
[0] Designing for billions of writes per day, JSON API 1.1 + auto linking and pagination, dead simple defaults for controllers, lots of extra methods for better code legibility, etc. I've been thinking of extracting it all out into its own thing but I don't want to deal with the headaches of communicating breaking API changes.
There was a good blog post about this from Thomas Reynolds the developer of Middleman a little while ago[0]
[0] https://awardwinningfjords.com/2015/03/03/my-weird-ruby.html
I agree with parent, ruby is a pain to work in, especially if you’ve drunk the FP koolaid. I’m back doing rails again after a while doing react front end stuff and a bunch of own time elixir. Ruby needs to allow more functional programming imo.
Ruby has rich exception handling mechanisms, but everyone just uses "rescue" without any arguments (or worse, "rescue Exception") because of the elusiveness of the answers to that question.
(Not trying to start Java v Ruby here, just looking at how exceptions work)
This way knowledge can be slowly wrapped around the failure modes as they get seen.
This is the complete opposite of my experience as a Ruby developer. Ruby performance is starting to get really good!
Meanwhile, Python, JS, Go, Java jobs run the gamut from webdev, ML, to game programming, and custom BI.
Not saying people aren't using Ruby out there, but 5-6 years ago it was all the rage. Couldn't turn around w/o bumping into a Ruby shop.
It seems to have settled into a Niche of "Rails devs" and Ruby fans using it.
In Japan there is a lot of attention on Embedded Ruby (hence the performance improvements). 99% of the professional Ruby work that I've done here in NY is not Rails. I've done everything from webdev (Jekyll, Sinatra), ETL work, to systems engineering all in Ruby. I've toyed around with Ruby & SDL but the performance at the time (4 years ago) was not good.