DEV Community

What’s your opinion on the Ruby programming language?

Jess Lee on April 13, 2020

DEV is in the process of launching a podcast and we'd love for you to be involved! We're recording the episodes in advance, and this week we'd like...
Collapse
 
robole profile image
Rob OLeary • Edited

It's a rare and beautiful gem ❤️💎😉

Collapse
 
krthr profile image
Wilson Tovar

I like ruby because it is very easy to read but in terms of speed it leaves a lot to be desired compared to other technologies I use :(.

That's why I currently use Crystal (which is like a "Ruby", but compiled).

Collapse
 
omrisama profile image
Omri Gabay

I agree that Crystal is exciting, but dude. Ruby has come out faster than Python and sometimes Node in a few benchmarks...

Collapse
 
_hs_ profile image
HS

Can you share link to those benchmarks? 2 main reasons for not using Ruby now for me are not so type safe (at least in 2016 when I tried it, it appeared not to be) and way slower in my cases than JVM languages. Keep in mind I stated my cases; where I need type safety for my own protection and I do not need simple calls to underlying libraries written in C or whatever, these are libraries I needed for domain specific work.

Thread Thread
 
omrisama profile image
Omri Gabay

benchmarksgame-team.pages.debian.n...

Granted, they're using the JIT which is still relatively experimental in Ruby but... yeah.

benchmarksgame-team.pages.debian.n...

Thread Thread
 
_hs_ profile image
HS

Thx

Collapse
 
krthr profile image
Wilson Tovar

Yep. I don't like Python hahaha

Collapse
 
_hs_ profile image
HS

First time I hear about Crystal but looks nice. Thanks

Collapse
 
moopet profile image
Ben Sinclair

It's weird. Everyone seems to think it's easy to read, but I find it's a pain - I'm constantly scooting my eyes back and forth trying to translate it into something that makes sense to me. A lot of the syntax seems to have been implemented just for the hell of it rather than for any good reason, and I've never learned to use it beyond the basics.

What I'm saying is, it might well be a great language, but its first impressions always put me off.

Collapse
 
kwstannard profile image
Kelly Stannard

What prior languages do you know?

Also, A lot of things in Ruby have more than one syntax in order to allow for various styles from prior languages, so you may have come across a strange code base.

Collapse
 
scrabill profile image
Shannon Crabill

Ruby is great. I love it.

Coming off of having learned (and struggled) with Javascript, learning Ruby felt like caaaaake. I found it very easy to understand and build that understanding to Ruby on Rails relatively quickly.

Collapse
 
michi profile image
Michael Z

I would love to pick it up, maybe just because of how DHH speaks of it :D

I recently tried it and one thing that put me off was the installation. I couldn't access installed gems like rails and searching online for the issue it seems there is a wide range of bundlers people use and I just couldn't find help for my super basic setup. I will probably try reinstalling everything again once I have a little more free time.

Collapse
 
rhymes profile image
rhymes

I suggest using rvm not to depend on the operating system's ruby :-)

Collapse
 
kwstannard profile image
Kelly Stannard

I would suggest using chruby. It was reviewed and approved by the head rvm maintainer. The only reason to use RVM these days is if you are maintaining a legacy app that needs it.

Thread Thread
 
rhymes profile image
rhymes

Didn't know about chruby! Going to check it out :) Thanks!

Collapse
 
lbonanomi profile image
lbonanomi

Needing to use rvm was honestly a big reason that I let my ruby use dwindle to just chef customizations; I really couldn't stand having to maintain more than 2 package catalogs.

Collapse
 
val_baca profile image
Valentin Baca

My opinion is that it Ruby, along with Python, greatly improved the programming ecosystem for the better.

By putting an almost dogmatic focus on programmer's time over cpu time, the language allowed for elegant and beautiful features.

I came across Ruby around 2010 (circa Ruby 1.9) in my last year of college. Until then I'd written mostly in C, C++, Matlab and a small bit in Java and Scheme. I recall reading The Ruby Programming Language from front-to-back and just being in awe of the language. It's safe to say it's the first programming language I ever liked-liked. "Love" is a bit too strong...but it's close.

I started working through Project Euler problems using Ruby and was astounded by how Ruby handled FixNum to BigNum seamlessly.

Then I hit the performance wall. I can't blame Ruby, since I was a fledgling programmer and was probably throwing O(n^4) programs at irb. But you can say that I had my first "heartbreak" with the language.

At the time Rails was also really taking off. To the point where it was very obviously a fad/bubble but you couldn't help get swept up in it.

Then I think the Twitter rewrite from Ruby to Scala really took a "gem" out of Ruby's crown. Even though 99.9999% of companies are not going to have the scaling concerns that freaking Twitter is going to, everyone likes to imagine their startup will be the next Twitter and thinks that choosing Ruby will stop them from getting there, even though it's likely that Ruby's expressiveness is what got Twitter to where it would need a rewrite!

So yes, the "ruBY Is SLoW" argument won't go away anytime soon, but for me personally, Ruby was a level-up in my understanding of programming languages. I still find my thinking to be somewhat rooted in Ruby. Like when I had to learn Objective-C, I thought of Categories as akin to Modules. As I learned and am re-learning Lisp, I see Lisp's influence on Ruby and can better understand one because of the other.

I'm glad Ruby exists if nothing else to be a force pulling other programming languages to focus on programmer expressiveness.

P.S. Like others have mentioned, I'm also keeping a close eye on Crystal as it seems to be the optimal balance between expressiveness and ease of Ruby but with C-like blazing speed. It's more type-strict than Ruby and doesn't have the full "range" of Ruby, but it's super fast and super easy to pick up.

Collapse
 
ivantoniev profile image
Ivan

I have been working professionally with Ruby more than 6 years now. I love how easy it is for me to throw something together that works be it a web service/API with Sinatra or Grape, a command line script or anything with Rails. I love how easy it is to use and handle gems and ruby versions between projects (rvm/rbenv/chruby and bundler help with that). The best practices are mostly agreed upon within the community, we have Rubocop to make sure we are following these. There's lots of materials to study from, lots of open source and friendly people to help.
If you are looking for something to quickly setup a web backend and deploy (to Heroku) with just a git push, Ruby is great.
If you think that it can't perform, check Shopify's Black Friday stats.
A lot of people talking about types, there's a project called Sorbet (developed by Stripe) that brings a form of type checking to Ruby.
Ruby has mature testing tools (RSpec, capybara etc) and is one of the communities that really believes in good testing practices.
Would be happy to chat to anyone wanting to get more into Ruby and having difficulty with something.

Collapse
 
leastbad profile image
leastbad

I thank the dark powers every day for Ruby, which was designed by its creator - Matz - with the express goal of making programmers happy. The ethos of happiness runs deep in the language. In fact, we have a saying/acronym: MINASWAN. Matz is nice and so we are nice. That has been demonstrated over and over during the 16 years since I started working with it.

The weird thing about our niceness is that it seems to make some developers who love other languages deeply uncomfortable, as though our niceness makes them somehow less nice by depleting some finite supply of niceness. If you're ever reading comments from someone who seems to wish Ruby would just roll over and die because it's inferior to what they like, chances are they just aren't prioritizing being nice.

The other thing that I find really compelling about working in Ruby is that it tends to draw some of the most interesting, creative, eccentric and artistic folks. Most of the best Ruby developers are deeply skilled in other, more traditionally "right-brained" disciplines, whether it's music, linguistics, art. Some of the wackiest characters I've met in my development life have been Ruby luminaries.

Collapse
 
kayis profile image
K

Honestly? I never used it.

When it was hyped around 2008/09, because of Rails, all of my friends used it at their internships, but they didn't like it anymore when they came back.

I used PHP at that time and switched to JS in 2011, so Ruby was never talked about in any way at my jobs.

Collapse
 
tomsfernandez profile image
Tomas Fernandez

Great language, would be better if typed hehe. It really would be awesome for real async and concurrency support.

Collapse
 
_hs_ profile image
HS

Both reasons for which I don't use it on current project. A lot of IO calls where cost is lowered by using async stuff by having app not scale because there's no need for more (count of or powerfull) instances.

Collapse
 
geewiz profile image
Jochen Lillich

You might want to check out Crystal or even Elixir.

Thread Thread
 
_hs_ profile image
HS

I've looked at Elixir before. Never had time to really test it out. However, gotta say on big and complex data it looks less optimal than JVM stuff. I know people like to protect elixir/erlang but if you have complex data and you need to do stuff with it JVM still rocks although I would like Elixir for other stuff. I like Scala but Elixir is more pretty. Feel like a teenager don't know what I want too much good stuff

Thread Thread
 
rhymes profile image
rhymes

To be fair, Erlang has been running global telecommunications for decades (Ericsson, T-Mobile run their nodes with it, many LTE nodes run on Erlang) and it's the system WhatsApp (which has quite a few users :D) runs on. OTP, the platform Erlang uses, also contains a distributed real time database called Mnesia.

Ericsson uses Erlang to develop many of its products and an estimated 40 percent of all mobile traffic worldwide is carried over the company’s network solutions. This means that a substantial part of all mobile voice and data calls are enabled by Erlang code. The number of Erlang users outside the telecom industry has increased over time and includes companies such as WhatsApp, Bet365, and Klarna.

from Erlang celebrates 20 years as open source

Companies use it for massively scalable systems so I think it's quite battle tested. Not a comparison to the JVM, there are very complex software architectures out there running on the JVM but I wanted to shine a light on Erlang for a moment :-)

Thread Thread
 
_hs_ profile image
HS

That's not the point, it's much better for passing small data in high volumes. Data transformation and calculation is another thing. JVM is not excelent at big numbers but it's a bit better than Erlang so it's in between hardcore language for math and excelent IO like Erlang. That's one of the examples. Also transformating 20MB+ json to yourown stuff can be pain but with JVM stuff i do it quite easily although it's bad to do such thing anyways sometimes you have to do it. That's another example. I would love to use all technologies but that's not always possible

Thread Thread
 
rhymes profile image
rhymes

My point wasn't a comparison though, I was just highlighting Erlang.

I agree that we can't always choose the technology we want to use or use them all at the same time :-D

Thread Thread
 
_hs_ profile image
HS

Oh, sry, I take Erlang/Elixir as the same thing I thought you were pointing stuff out to compare them but you just want to mention battle tested part. Yeah I agree it's more than battle tested. Hope I get time to learn it soon

Collapse
 
thealiilman profile image
Ali Ilman

I was slightly reluctant to use Ruby early on due to the demand that seemed average unlike JavaScript or Python.

After 2 years though, I’m glad that I picked up this language. It’s beautiful and sometimes, this is inexpressible. 😍😍😍 Writing code in Ruby almost feels like writing sentences in English.

Collapse
 
joshidhruv profile image
Dhruvkumar Joshi

I love the Ruby, and with the Rails. I can spin up a simple Web App with API in minutes. I have never struggled in Ruby, Its like you dont need to be a fancy dev to write great ruby code. Its just happen to be Simple, Neat and Clean code that anyone can read. #loveit #ror #7yearsOfRailsExp #ror4lyf

Collapse
 
stojakovic99 profile image
Nikola Stojaković • Edited

If you ask me, Ruby is a perfect mix of Perl, Python and Smalltalk. Although I prefer C-like languages, I enjoy writing Ruby code whenever I need to work on company projects written in Rails. It's sad to see it's not popular as it was before, however, it's mature and has vast ecosystem ready to support almost anything you can imagine on the web.

Collapse
 
brownio profile image
Antonio Djigo

Wish it had more standardised uses apart from Rails, it's a beautiful language that should not be forgotten :(

Now I'm going for Go instead tho.

Collapse
 
abdurrkhalid333 profile image
Abdur Rehman Khalid

Being Having a Strong Background of Java, First I felt it very easy and Clear to Understand, then When Loops came they made be a bit confusing, after that when I moved to the Object-Oriented Programming I felt quite nice.

When I moved towards the Ruby on Rails Framework, I felt comfortable and easy to understand the Model View and Controller Pattern as well.

Collapse
 
jcolag profile image
John Colagioia (he/him)

I like and use it, but wish its initial burst of broad popularity had held on through the rise/expansion in tooling and libraries other language ecosystems had. Compared head-to-head with just the compiler or interpreter for other languages, it has a lot of conveniences. But comparing its ecosystem with a JavaScript that can add static type-checking, a pretty-printer, and treat style issues as if they were fatal errors, Ruby is harder to use for large-scale engineering than it could be. Python, JavaScript, and C# seem to have much more investment in their libraries and their flagship web application frameworks have mostly caught up to Ruby, as well.
But on "the other other hand," Ruby has also invested a lot more effort into making sure their community is sustainable, putting it far ahead of other languages in that respect.

Collapse
 
erikwhiting88 profile image
Erik

Right now, Ruby puts food on the table. I loved learning it in college and when I got the opportunity to write it professionally, I was ecstatic.

It does feel like writing English sometimes, but the downside is that a lot of that "English" is based on what you and your team have named things. So I think Ruby can turn a good design into a beautiful code base, but it'll make a bad or even mediocre design turn into an unmaintainable mess

Collapse
 
omrisama profile image
Omri Gabay

Ruby is the greatest invention since sliced bread.

Collapse
 
jhechtf profile image
Jim Burbridge

I don't like indent-based languages, but at least Ruby as end statements

Collapse
 
leastbad profile image
leastbad

Ruby isn't an indent-based language?

Collapse
 
rnrnshn profile image
Olimpio

Easy to grasp syntax but hard to implement or build something. A lot of dependency gems... Rails is hard... But I like Ruby...

Collapse
 
buinauskas profile image
Evaldas Buinauskas

Started using it in my new job. I do wish it had types for better autocompletion and self-documentation.

Other than that I do like it so far for being elegant and human-readable.

Collapse
 
ackmandesu profile image
AckmanDESU

This. I love ruby but after a year of using Typescript + C# only I can say I definitely don’t miss having to fuck around to get proper completion.