top | item 18873581

Happy Birthday, Ruby

387 points| _quhg | 7 years ago |github.com | reply

232 comments

order
[+] kemenaran|7 years ago|reply
I'm currently working on a Ruby project, and I love the language so much! It's elegant, fast enough for me, and the ecosystem rocks.

It seems that, after Ruby borrowed from many previous languages, a lot of rubyisms went into Rust (the nice functional-style enumerations, the awesome package manager inspired by Bundler). And I'm thrilled the best of the Ruby world found its way into other languages.

A future where the elegance of the Ruby language is available both as an interpreted-scriptable tool (Ruby) or a compiled-statically-typed language (Rust) looks like a nice place to me.

[+] marcolussetti|7 years ago|reply
Wouldn't Crystal fit the bill for a fast compiled language explicitly designed to emulate Ruby's syntax? (I don't have any significant Ruby or Crystal experience, so if there are reasons why that doesn't fit the bill, I'm sorry)
[+] tomphoolery|7 years ago|reply
I think we've arrived at that future. With languages like Crystal, Rust, Groovy, and Elixir, you can get some of the same powers that Ruby bestows upon you in other environments like a statically compiled binary, the JVM, or the Erlang runtime (with it's lovely OTP framework). I even see JavaScript taking on some Ruby-like characteristics these days.
[+] jtms|7 years ago|reply
Check out Crystal - Its statically typed, compiled, and a near one to one implementation of Ruby. https://crystal-lang.org
[+] renox|7 years ago|reply
I read about Ruby, indeed it's quite elegant but if it's "fast enough" for you then any language is fast enough for you.. /S
[+] pavlov|7 years ago|reply
Ruby is the very least favorite of all the programming languages I've had to use regularly over my career.

Its syntax strongly favors cuteness over familiarity. Wherever Ruby can diverge from expectations to give you a pointless little tickle of whimsical inventiveness instead, it seems to do so.

Visually it looks like an unwanted love child of Pascal and Python. There's no clear rhyme or reason to the use of sigils and keywords.

The standard library and built-in types are acceptable for a mediocre '90s scripting language, I guess. The difference between symbols and strings as hashmap keys is a footgun that opens up endless bugs for the type of glue code that you'd often be writing in Ruby.

Probably the only thing that keeps Ruby afloat is Rails, an extremely resource-intensive web server framework built around assumptions of what web apps were like in 2003. Everything in Rails seems to happen by pooping magic keywords in your code or in file names according to mysterious conventions, so when something goes wrong, you'll have a hell of a time figuring out why Rails isn't calling your code or is generating broken SQL. OTOH it honors the Ruby tradition of doing lots of unexpected and useless cute things like pluralizing words in your database migrations [1].

[1] https://stackoverflow.com/questions/1185035/how-do-i-overrid...

[+] TheRealDunkirk|7 years ago|reply
So, I'm old, and have done lots of stuff in lots of languages in frameworks. For about a dozen years, Rails was my go-to toolkit. I've written a couple dozen production applications with it. Unfortunately, Rails has really fallen out of favor lately. Even a Rails-specialty shop I worked for briefly has pivoted to using ASP.NET. I've played around in that stack, and found it lacking. (EF just doesn't compete as an ORM.) However, they've moved on to bigger corporate customers, and those places just don't use Rails.

Recently, and because of this same we-don't-"do"-Rails sentiment, I was forced into using Java for a web application. So I prototyped a site with Spring and Angular 6, thinking this -- arguably -- represents the "state of the art" when doing a Java web app. Out of frustration, I also cranked up a prototype with Rails. What was taking me literally 160 lines of Java and JS, to build two related models and a form to edit the relationship, took me 3 lines with Rails. Nothing else I've found allows me to be as productive as Rails for writing web applications.

I can understand criticizing Ruby for being clever. There are still magic tricks you can do with it I've never even tried to understand. I can understand criticizing Rails for being obscure. I realize that it took me MANY years to be REALLY effective with it. But if you're telling me the alternative for web applications is ANYTHING related to Java, I'll call you crazy.

I've just inherited a Laravel-based PHP site, which is so old I can't download the version of the framework it uses. Yikes. I did PHP for about 10 years, 20 years ago. It doesn't feel like a lot has changed.

So, I'm honestly asking, as someone who hates Rails: What framework, out there, somewhere, allows me to be as productive as Rails, but which is are "better," somehow?

[+] skywhopper|7 years ago|reply
I don't understand your bit about "cuteness over familiarity". Can you give an example outside that's not Rails-related (given that Rails seems to be the main source of your concrete complaints)?

Sigils in Ruby actually do have strong and clear meanings. And the difference between symbols and strings is a useful distinction. And contrary to your statement, Ruby's stdlib is far more complete and more internally consistent than what you get from Perl or Python, so I'm not sure what your beef is with that.

It's fair not to like particular decisions a language has made, but from what you say, I'm not getting the sense that you understand the decisions Ruby has made well enough to criticize them effectively. Again, it seems like your experience was colored heavily by Rails, and fair enough if that's the case. But stick to criticizing the actual source of your problems.

[+] Rooster61|7 years ago|reply
> Its syntax strongly favors cuteness over familiarity.

Funny, I recently made a stack switch from Ruby to Python, and I had the exact opposite impression. Ruby coding style/syntax tends to favor convention over configuration (at least in terms of Rails setup), while Python to me seems less so.

Ruby also seems to me a bit more consistent across it's versions. One of the biggest gripes I've had about Python so far is how many things are broken across various versions of the language, and the odd way some issues have been handled (having two distinctly different types of strings with distinctly different syntax according to encoding for instance). Perhaps Ruby simply doesn't offer familiarity to you individually.

I'm more comfortable with Ruby as I used it much longer, so I may be biased, and I am not shitting on Python either. It has things I don't particularly dig, but that may be my own bias. Both languages have their pros and cons, and both are certainly viable as scripting languages in this particular epoch of programming.

[+] welliman|7 years ago|reply
Whimsical inventiveness is the one thing that keeps me enjoying the art of programming.

There's a tension in programming between being verbosity and ingenuity. More flexible languages and programmers general favor ingenuity, while rigid ones favor verbosity. When people complain about the "magic" in Rails, it's usually because it's a pattern that is new to them, and they would have preferred an older pattern even if it was a more verbose one. Which is fine, but it is a preference amidst a large spectrum of tradeoffs. Unfortunately, many people tend to not see most tradeoffs in software engineering and try to come up with as many reasons as possible for why their way is right and the other way is trivial, stupid, cute, or useless.

[+] izietto|7 years ago|reply
"pluralizing words in your database migrations" is ispired by convention over configuration pattern, and comes from an age where there weren't almost any standard rules, even table names were some singular, some plurals, some ALL_UPCASED, some all_downcased, some MiXeD, some dash-erized, some camel_ized, ... I come from that age and it helped a lot.
[+] evancaine|7 years ago|reply
> Ruby is the very least favorite of all the programming languages I've had to use regularly over my career. > Its syntax strongly favors cuteness over familiarity

How do you define regular? I use both Ruby and JS almost daily, and have previously used Java and python for several years. I find ruby a joy to use and have no issues with 'familiarity'

[+] swat535|7 years ago|reply
Your complaints regarding ruby has been noted. It's not you favorite language and that's cool.

Every language out there has pros and cons with different set of tradeoffs , you can't point at a language and objectively say X is better than Y.

Ruby has its place and whilst you think Rails is "magic" the internet begs to differ. Of course any framework looks like "magic" if you don't bother digging into implementation details of it. That is the whole point!

The fact that so many successful companies are using rails in production and scaling it, just shows the complete opposite of what you claim: "an extremely resource-intensive web server framework built around assumptions of what web apps were like in 2003."

There has been plenty of times where i wondered how a piece of AR worked and popped over to the Rails github repo and quickly glanced over the details and had no problem understanding it.

You are entitled to your own opinion, but from the outside, it looks like you are just not familiar with ruby.

[+] fouc|7 years ago|reply
I think you need to share your favorite programming languages so that we know the type of language you are biased towards, and why you might dislike ruby.
[+] nwmcsween|7 years ago|reply
How long did you program in ruby? Since its an OO programming language the keywords are per object which makes things simple to understand. Ruby was the first language I really enjoyed and allowed for some really nice DSLs. Even Rust borrowed syntax from ruby (although more ugly IMO).
[+] Buttons840|7 years ago|reply
Early in my career, I only "knew" a little C++ from a high school programming class I had taken, and I knew a tiny bit about Java.

Then I found Ruby, and people talked very highly of it. But it had all these "Gems", I couldn't figure out what a Gem was. I didn't know enough. I thought it was like a compiler plugin or something. I thought that just like there were different versions of Java, there were different versions of Ruby called Gems.

Then I found Python, it had "libraries", I knew what a library was, it was something you could download and use in your code. I learned Python and liked it a lot. If Ruby had "libraries" instead of "Gems" I would have learned Ruby instead since I was exposed to it first.

[+] zackmorris|7 years ago|reply
Ok I'll bite. Ruby's biggest flaw is implicit context, due to its emphasis on convention over derivation. Which means that (for example) a developer new to Ruby/Rails won't know that paths are automatically generated from routes.rb, or how those routes and paths automagically connect to controller classes. It's not clear in the beginning how symbols relate to strings or why you would even want them (they are like enums so have better performance, but other languages get around this with better string comparison techniques), or how hashes relate to the associative arrays in other languages, or why hash method work differently from array methods. For example:

https://apidock.com/ruby/Hash/flatten

Which doesn't recursively flatten like Array#flatten, even when depth is specified. To me, most of these choices are arbitrary or done for performance reasons which get less compelling with each passing year.

I never know from one day to the next which new concept is going to be thrown at me, or how much I'm going to have to memorize. Whether it's Rails, or Rspec, or any other gem - each has its own ecosystem of technobabble that can't be derived from first principles.

In the end, I don't know what problems Ruby is trying to solve. I find it no faster to write than PHP or Javascript. I find that having multiple ways to specify blocks with begin/end and {} merely increases the permutations I must hold in my head as I'm trying to grok code. This is all very perl-like, which makes sense for a 90's language. But I wouldn't advise learning Ruby or using it in production today. Better to go with a more formal language such as Go/Rust/Swift/Kotlin, even though each of those has its own unique set of flaws and pain points.

P.S. If you are struggling with learning Ruby, I highly recommend learning PHP/Laravel first. It has most of the same concepts as Rails/.NET but builds on the existing context that C-style language programmers tend to be familiar with. Then from there you can create a virtual errata document in your mind to store any arbitrary conventions that Rails introduces.

[+] DFHippie|7 years ago|reply
>There's no clear rhyme or reason to the use of sigils and keywords.

You have trouble with the use of sigils in Ruby? That seems like an odd complaint. I would have expected you to complain more about MINWAN.

[+] beforedawn|7 years ago|reply
So true. Best was ActiveRecord, the most cumbersome ORM I have ever met, it could create 20 SQL requests out of a simple query.

There must be a reason that Ruby dropped few places on Github's Octoverse 2018.

While I was never against Ruby, every time has its tools, it was the culture of the Ruby community which I didn't like. Being a Rubyist was always a good excuse to not help on the frontend or help with some devops.

Now they escape into Elixir which is the next good academic excuse to not help with the frontend because React is so working class...

[+] vinceguidry|7 years ago|reply
Rails has an answer for the hashmap keys problem, HashWithIndifferentAccess.
[+] DJHenk|7 years ago|reply
I wholeheartedly agree. My main gripe is that people insist Ruby is 'easy', because it 'looks just like English'. Yeah, well, it doesn't.

Programming languages are different from normal languages because they have different goals, different users and different requirements. The result in of this forced unification in Rails is something that resembles English, if you squint really hard, but in order to do so, it uses a massive amount of non-intuitive assumptions (sorry: conventions) that I as a programmer somehow should know. This makes debugging unnecessary hard. Also, when developing new features I'm constant guessing whether I should this or that form. The only way to find out is trying things out. This is fun as a hobby, but irritating when you're on the clock.

The idea that a programing language can be unified with a normal language is offensive to me both as a programmer and as a writer. They only benefit is that people who are not programmers can dabble around and still make something useful. Which isn't nothing, but not for someone who programs professionally.

[+] thunderbong|7 years ago|reply
I discovered Ruby in 2005 and immediately fell in love with it. Then came across Rails which really tested that love, what with it's opinions and everything!

And finally reached Sinatra, then Roda and love prevailed! Along the way, discovered and enjoyed working with so many gems both in Ruby as well as part of it's packages!

So, after 13 years now, I'm glad I chose the right language. A language which always asks, is there a simpler, more beautiful way to do the same thing?

So, Happy birthday, and thank you.

[+] colinbartlett|7 years ago|reply
I’ve also been using Ruby full time for 13 or 14 years and I am really hoping its popularity and commercial viability continues for another 13 years (or another 25).

I’m certain my level of mastery contributes to my enjoyment. And it’s not that I don’t like learning new things, I do! But Ruby is just an absolute pleasure to write, and it’s hard to imagine spending 8+ hours a day living in any other ecosystem.

[+] sho|7 years ago|reply
> Ruby isn't the most beautiful language out there

Huh, I sure think it is. I wonder what the author thinks the competition might be? Ruby has its issues for sure, but aesthetics ain't one of them - far and away my favourite out of any major language.

[+] hirundo|7 years ago|reply
The author of this piece is Dave Thomas, who also wrote:

"I came across Ruby in 1998 because I was an avid reader of comp.lang.misc (ask your parents). I downloaded it, compiled it, and fell in love. As with any time you fall in love, it’s difficult to explain why. It just worked the way I work, and it had enough depth to keep me interested.

"Fast forward 15 years. All that time I’d been looking for something new that gave me the same feeling. Then I came across Elixir, a language by José Valim, that puts a humane, Ruby-like syntax on the Erlang VM."

So while he loves Ruby he's mostly moved on to Elixir, which he loves partly because of how it builds on the ideas in Ruby.

[+] smitherfield|7 years ago|reply
> I wonder what the author thinks the competition might be?

I think he meant beautiful in the conceptual sense (e.g. a beautiful algorithm) not the aesthetic sense.

Aesthetically speaking, Ruby would definitely be in my top 3 and possibly first. For me its main competition is ML-syntax languages, in particular Standard ML and F#.

[+] empath75|7 years ago|reply
I'm not sure what language would be more beautiful than ruby, to be honest, and it's not even my favorite language to use.

Let's do a mini code challenge in the thread -- implement fizzbuzz in the most beautiful way you can, in the most beautiful language you know:

[+] loktarogar|7 years ago|reply
Ruby was my re-entry into programming. Before it, I had tried programming in highschool (c++) and, while I did well at it, felt like it wasn't for me. I was going to go into some other field like Photography instead.

By chance I had to do a programming class in college, and they had put me into the wrong one by accident - a final year software project in Ruby. I did really well at it, fell in love with the language and got into other programming languages from there.

I've been doing Ruby for 12 years now and it's my go-to language when I can choose. My entire programming career has Ruby to thank.

[+] sho|7 years ago|reply
Me too actually. I flirted with programming around uni-time and after - PHP, java, friggin' ada - and just couldn't see myself enjoying it so I went into network management instead.

10 years later I was thoroughly sick of that, so started to look around and heard about this little language called Ruby - and it was love at first sight. Then this little software project called Rails started to gain momentum and there was no looking back. 13 or so years and counting.

And now funnily enough just when I feel like Ruby is lacking a few necessities in our always-connected world, along comes a project which is basically reworking Erlang to look a whole lot more like Ruby - Elixir. I'll always love Ruby but Elixir feels right for the next step, that kind of instant attraction I never felt for the likes of golang. Here's to the next 13 or more years of Ruby-like programming joy!

[+] nickdrozd|7 years ago|reply
> Ruby changed my life. Ruby gave me a whole new way of looking at things, and a whole new set of friends.

Matz himself said something similar about Emacs / Lisp [1]:

> Emacs made me realize anything can be changed by a programmer...Emacs taught me freedom for software...Emacs has changed my life

[1] http://ergoemacs.org/emacs/Matz_Ruby_how_emacs_changed_my_li...

[+] katabasis|7 years ago|reply
Years ago, as a (traditional) designer trying to learn how to code, I spent what felt like an eternity trying to wrap my head around JavaScript. This was in the ES5 days. After a lot of effort I could usually do something approximating what I wanted, but there were a lot of stumbling blocks that got in the way of really understanding what was going on.

Once I learned Ruby, the fog parted and everything started making sense. Compared to JS, Ruby was transparent. Everything was just a bunch of objects sending messages back and forth to one another. The simplicity of defining classes and methods made it easy to think about how a program could model aspects of the real world – domain modeling, abstraction, etc. One early experiment I recall was using Ruby's built-in Enumerable and Comparable modules to represent a deck of playing cards in code (complete with > and < methods which respected suit, royalty, etc) – this was a real "aha" moment in my learning process.

Reading code written by others was much more straightforward (making it easy to learn from the masters), and writing extensions/plugins to existing tools to add features that I needed suddenly became feasible. Books like David Black's "The Well Grounded Rubyist" and Sandi Metz' "Practical Object Oriented Programming in Ruby" were great, accessible introductions to the art of programming.

I don't write much Ruby any more, but I'm in total agreement with Dave Thomas here. Ruby for me was the "royal road" into learning how to program, and it continues to inform the way I think and write code in other languages. As a non-CS person, I can't think of a more accessible way to learn about software development.

[+] barbecue_sauce|7 years ago|reply
There is one thing I really dislike about Ruby (and other languages like Scala that have the same feature), and it's non-parenthetical function invocation. I get that it's good for writing DSLs and similar endeavors, and you're only supposed to use them where its implicit what you're doing, but in my opinion, it really hurts readability (though Scala is much worse when it comes to flexible yet opaque syntax).
[+] jaggederest|7 years ago|reply
Unfortunately you really can't get the refactoring capabilities without being able to substitute a method for a local variable transparently, which is extremely useful over the long run.
[+] rufus_2|7 years ago|reply
In July 2009 around Rails 2.1.2, I decided I'd be happy if I could write Ruby for a living for the rest of my life... So far so good!
[+] mberning|7 years ago|reply
It seems like it is currently Ruby's turn to take a beating just like Java before it. I guess people relentless hate on Java even to this day, so maybe it will never get much better. But Ruby certainly holds a special place in my tool box. Here's to another 25 years.
[+] BlameKaneda|7 years ago|reply
Ruby's readability has been a huge plus for me, and I love working with Rails. I've only completed one Rails project, and I want to work with it again in the future.
[+] weeksie|7 years ago|reply
This makes me wistful for the 00s and Ruby back when people like _why were around doing fun, weird stuff that felt more like art than engineering. Of course much of that is mixed up in my own early 20s and Ruby as the first language I truly fell in love with. I'm sure just as much (probably more) great weirdness is going on right now, so maybe I'm not mourning that as much as experiencing a maudlin touch of nostalgia.
[+] aboutruby|7 years ago|reply
> > Matz is clever so we can all feel a little smarter, too.

> (OK, I just made that up)

I liked it :).

[+] hirundo|7 years ago|reply
Careful, Oscar Wilde said something like (can't find the exact quote) "I always feel smarter after listening to you." It wasn't a compliment.
[+] skywhopper|7 years ago|reply
Great writeup! I agree that Ruby is a remarkable language. One that changed my perspective about what a language could be while at the same time combining some of my absolute favorite ideas from Perl, Smalltalk, and Scheme into a syntax far cleaner and more satisfying than almost any other language I've worked with.

Dave Thomas's Programming Ruby was a fixture on my office desk for a decade. One of the best programming books I've ever read, with a fantastic reference section (built from Ruby's own excellent baked-in docs), my copy is well worn, and I still find reasons to dig it off the shelf from time to time.

I can't give enough Kudos to Matz, Dave, and the rest of the Ruby community for bringing this language into my life. The community they've built is truly amazing, and the language has endured even as it's grown with far fewer bumps and jolts as compared to other similar languages over the same time period.

In summary, quite simply amazing! Happy Birthday, Ruby!

[+] claudiug|7 years ago|reply
All my accomplishment happen because of ruby. I've been unhappy and depress with java(2006-2010) and then I manage to move to ruby. And I totally like the language. I'm sad when people say python is more nicer, or the nicer and better language there. I've done python and I never find it appealing as ruby
[+] gnulinux|7 years ago|reply
What about people liking python makes you sad?
[+] joelbluminator|7 years ago|reply
Hope for another good 25 years :) if I can I will keep programming in it in my 50s and 60s.
[+] seanhandley|7 years ago|reply
This should have " (2018)" in the title.
[+] tomphoolery|7 years ago|reply
> Ruby is the Katamari Damacy of programming languages

love it.

[+] mcv|7 years ago|reply
After getting tired of Java's verbosity in 2008, I switched to a Ruby job, where I was fortunate to work with an incredibly talented developer and Ruby expert. It was a joy coding in Ruby after 4 years of Java and XML.

After that, I moved to Groovy, which seemed like a nice middle ground between Ruby and Java, or as I called it at the time: Java as it should have been.

I don't hear much about Ruby and Groovy lately, and while I focused more on front-end development, my back-end work rolled back into Java, which, I admit, has gotten slightly less painful with Java 8. At least in some ways; in other ways, it's just become an even bigger mess where some parts are sensible while other parts are dragging the weight of decades of poor choices with them.

I hear Kotlin is nice, though.

My Ruby skills have gotten a bit stale, sadly. The last thing I did with it was in 2013 I think, when I ran into trouble with Ruby's handling of unicode.

[+] jrvarela56|7 years ago|reply
I love the syntax, but I'm hating the debugging. Feel like a big chunk of my time is wasted chasing after errors that a compiler could catch for me.

Would love to have optional some kind of optional typing. Has anyone tried any of these? https://github.com/soutaro/steep https://github.com/plum-umd/rdl

Any other suggestions?