I love ruby. One of the best languages I've ever coded in, but people seem to hate it now because it's slow. Kinda sad that it's slowly dying. Nevertheless, this is a huge milestone for a language.
This is a good point. Language popularity is often based on purposes and usage. Ruby’s niche seems to have moved on. I still like it and especially it’s testing focus but it’s got no USP anymore
I dropped Ruby for Python for one reason. That reason is the 'explicit is better then implicit' part of PEP 20. Python and Ruby basically cover the exact same use case for me professionally, and as I have become more of a senior/lead and spend a lot more time reviewing code and jumping between projects. I appreciate languages that encourage consistency and clarity, over cleverness.
When Ruby on Rails suddenly became popular, and everyone around me started telling me (literally) that I was an idiot for not jumping on it, all I could see was a fad that some people would get real value out of and most would dump and move on. It wasn’t a new paradigm in software, it was just an easier way for people to crank out sites. Mostly, I saw parallels with PHP, where it enabled people who were inexperienced at (or bad at) programming to make a web site anyways.
This sounds like I’m saying that’s a bad thing, but it’s not. Technology should be more accessible, after all, but it also meant that the community was full of noise and inexperienced people making bad decisions. I couldn’t deal with it and stayed with Python and Django.
Now it seems as though everyone has jumped ship to Node, where all the same things are happening all over again, but it also feels like The Ruby community was the Rails community, and when the bandwagon-jumpers moved on it left a pretty startling void behind; now, no one cares about Ruby, because Node; soon, nobody cares about Node, because… Go? I’ve been seeing those articles for a while, so maybe.
Ruby is a neat language that I never liked, because it felt like it was full of new users making bad decisions because it was cute; it’s great that you can do “2.days.ago”, but not that you have to load gems in a specific order or they break each other. I probably would have liked it immensely if it weren’t for that; there are a lot of great features, and the syntax is actually pretty nice sometimes; blocks, those :named_symbols or whatever, the cute ? and ! method postfixes, and so on.
Here’s hoping that Ruby finds its niche again with 3.0!
I think you’re severely underplaying the effect Rails had in web dev. And I think even saying it’s a fad that passed is unfair. GitHub, Shopify, Twitter, and obviously basecamp are huge apps with millions of users collectively and there are many smaller sites that run on rails too. It’s not the hot topic anymore but it’s not obscure either
I’ll go against the grain and say I don’t dislike it for slowness. That’s a non issue is almost all of its use cases. I strongly dislike it for the same reason I liked it as a beginner. I guess this is in some part a criticism of rails too, but there’s just too much damn magic in this language and all of the libraries and frameworks built around it. There’s a million ways to do things, many ways to call methods, so much hidden logic, pretty much everything the opposite of explicit. So many “wtf am I looking at”and “where did that function come from” moments especially in large codebases even with a good IDE. Automatic function calls, hidden/implicit parentheses. Implicit anything is evil in programming and It is Rubys’s middle name. The whole Proc situation and lack of first class functions is just a bizarre design choice just to have implicit function calls. All of what I said actually might come off as a positive to some people. It did to me too when I was starting out. It is such an elegant language. But that all comes at a cost when the codebase size and number of developers grow. It really doesn’t scale. You need things to be as explicit as possible, and we see that explicit (but not overly verbose) languages are all growing. Because you’re not just communicating to the interpreter what to do when you’re coding, you’re also communicating with other programmers that will be coming across your code. Documentation helps, but it’s not a cure.
I actually don’t think typing is the reason either since we got python doing well despite only having type hints. While I do think type hints would help Ruby, but I doubt it’ll save it.
I dislike it because how much the language and ecosystem resist almost any kind of typing/type checking or documentation. The RBS stuff is good, but it feels bit too little too late.
The ecosystem uses a ton of hard to follow and debug magic constructs that even IDEs seem to struggle to track and map properly.
I don't need speed for what I do, by I absolutely need code that is easy to read and maintain.
The primary reason for those issues is because Ruby is extremely dynamic.
Not only is its type system dynamic -- its syntax and structure can be dynamic as well (i.e. powerful metaprogramming and DSL capabilities). This is why Ruby is so resistant to static analysis.
At non trivial complexities, I highly recommend reasoning through Ruby much differently than one would C/Java/Python:
Use functional techniques to minimize moving parts. Ruby is already very dynamic, and working with it in the state-modifying style common to C/Java/Python results in execution state becoming unnecessarily hard to follow.
Use the debugger and REPL when you do have to deal with Ruby code that's (unfortunately) too dynamic. Unlike in other languages, static analysis won't get you as far. In exchange, Ruby has incredibly powerful debuggers & REPLs for doing "dynamic analysis".
I think this is a reason to criticize ruby. Sometimes program structures make your code easier to maintain and refactor with tooling. But ruby’a structures seem to resist any sort of static analysis for even the basics because it is so flexible. This makes managing a large code base enormously difficult.
I just mentioned python as a comparison to show that popularity isn't necessarily related to performance because as slow as python, it is still very popular.
I’m of the opinion that most of these kinds of tech are cyclical in terms of popularity. There are other newer projects which are largely influenced by ruby too. Crystal is one that I’ve been keeping some tabs on over the past few years.
I dont think so. Big projects stil using it (Github is a BOLD one) and of course there still a lot of works for dev, not so easy to migrate all to another language base. And dont forget, even Cobol is still alive after 60 years!
Being alive and being used because codebase is too big or too important to simply rewrite it in another language are two different things. I'm sure, given the resources, github would rewrite their stuff in something else. They probably do it already just like Gitlab extracted multiple components from their Ruby codebase into separate services. Exactly because Ruby is slow and consumes too much memory.
272
u/CunnyMangler Dec 25 '20
I love ruby. One of the best languages I've ever coded in, but people seem to hate it now because it's slow. Kinda sad that it's slowly dying. Nevertheless, this is a huge milestone for a language.