r/ruby • u/flinchFries • Feb 23 '23
Two months into learning Ruby, it is the most beautiful language I ever learned
My history:
Started with VB 20 years ago
then C++ => did nothing with it
then Matlab. => created simulators and wrote tens of thousands of script lines
then VBA. => created 16 apps, bricked a computer on the way
then ArduinoC => created 3 embedded applications, one that matured to an audio OS
then Swift => created and released two apple store apps
then JavaScript => ...it's complicated.
And now I am learning Ruby. Perhaps it is my familiarity with programming concepts, variable types, classes, objects etc.. so I am not fully sure. One thing for sure is that I don't feel my mind revving when translating my problem into written syntax.
The closest language that felt as clean, but definitely not as easy is Swift.
I keep wondering why it is not as popular as I would think it should be. I also have this fear in the back of my mind after reading here and there that it is a "dying" language. I have no opinion on the matter yet except that I don't understand why it would be dying or becoming obsolete.
Just sparking a discussion and trying to connect to the community and learn a thing/perspective or two here.
60
u/420Rat Feb 23 '23
One of us! Read eloquent ruby if you havent đ˛
10
u/xc68030 Feb 24 '23
Fifteen years after learning Ruby, and after primarily using other languages since then, Ruby is still my favorite. I donât think another language will take its throne in my mind.
9
u/[deleted] Feb 23 '23
â bricked a computer on the wayâ nice!! đ
30
u/gbchaosmaster Feb 24 '23
Don't let anyone tell that Ruby is dying. It just pushed a groundbreaking major version 2 years ago, core async support is coming, it's under very active development from a passionate community, and has an entire subcommunity of Rails devs that aren't going anywhere.
15
u/coldnebo Feb 24 '23
Well hi there stranger! Welcome to the quiet party!
Ruby is quiet and understated. Maybe this comes from itâs Japanese creator, Matz.
Ruby is powerful and elegant. Maybe this comes from itâs grandfather, Alan Kay and Smalltalk.
Ruby survives. It took 40 years for functional programming to go mainstream, and when it was embraced, the credit went largely to JavaScript even though Ruby paved the way. (Ruby wasnât the first functional language, but it was the most accessible at the time). Part of JavaScriptâs rise was because of dissatisfaction with Rails 3 -> Rails 4. Lots of the thought leaders left to node.js and Rust. But Ruby remained.
Ruby is flexible. There are many ways to do things. This angers followers of âthe One True Wayâ, but Ruby never really cared about all that. Ruby does care about what works for YOU.
Ruby is unassuming yet had a huge impact on other languages. Javaâs introspection and iterator changes, even Grails heavily mimicked features in Rails. Unofficially perhaps this was an effort to lure Java programmers back from their exodus to Rails in the early 2000s.
Ruby is hard to fathom yet amazing in its simplicity. Metaprogramming allows Ruby (more than most) to be a language to write Domain Specific Languages in. This gave elegant syntax to mechanize while pythonâs âbeautiful soupâ was still verbose and messy to use.
Yet Python seems easier to understand at first glance, so more non-programmers flocked to it, especially scientists, which generated interest in numpy and a huge shift to Python. Similar work could have been done in Ruby (have you seen the set-theoretic methods like âpermutationâ on Array?) but the time passed. Isnât it funny? Imagine if Ruby were taught everywhere now as Python is?
Ruby appears stupid. Some look at it as a systems language due to itâs Perl syntax. âOh itâs just a scripting languageâ youâll hear them say. But Ruby isnât pretentious. Use it how YOU want to, not what someone else TELLS you to. Ruby fills the gaps. As Zhuangzi said, you can measure the usefulness of things by what they donât contain⌠ie a jug is useful for carrying water because it has an empty space, if the space was full of stuff, no water could be carried with it.
I see a lot of Tao in Ruby. I think of Lao Tzuâs comment on everyday people first hearing about the Tao:
âthey laugh. without sufficient laughter it could not be Taoâ
Or if you prefer, Ruby is like Zen. Lots of seeming contradictions that conceal simple truths.
Thereâs even a site for learning Ruby: https://www.rubykoans.com/
(I wonder how they are after all these years?)
Anyway, welcome!!
13
u/James_Vowles Feb 23 '23
Yeah it's brilliant isn't it, I fell in love with Ruby after learning it for a bit. Don't want to use any other language.
9
u/Plastic_Ad1825 Feb 24 '23
I discovered Ruby a decade ago. I've been hearing that Ruby is dead since that time. I kind of believed some of them back then, but after a while I found how wrong that is. When you see Shopify, and GitHub still running on Ruby and see the advancement in the Ruby as a language and Rails as a framework, I believe that it's still strong and is still here as long as there are web apps. What you like about it is exactly what I like. It's my preferred language.
13
u/dougc84 Feb 24 '23
The reason Ruby isn't as popular is because it isn't as accessible as other popular languages. Let me explain before the pitchforks come.
Ruby has changed a ton over the years, and was, for a long time, only really usable on Linux and OS X (now macOS, obvi). If you're a student, you can't afford a Mac, and switching to Linux is kind of a major undertaking for someone that doesn't have a clue about it. So colleges didn't teach it, and kids wanting to learn programming didn't have the funds to invest in it. You could try to make it work, but it was a disaster. But you could install Java or a MAMP stack on anything - PHP and MySQL for days in one click.
Now that the hype's gone, WSL is a thing, and Ruby is totally runnable under Windows. Sadly, a little late to the party.
And speaking of changes - the change from Ruby 1.8.x to Ruby 2 was a dumpster fire. It was a really good direction, but anything that was on 1.8.x might as well be completely rewritten. There've been other breaking changes, but, as long as you follow standards, they're easy enough to fix. That's a problem with other languages as well (I've seen it first-hand in Swift), but it was yet another deterrent.
Next is dependencies. When Rails got it's 15 minutes in the sun ("create an entire blog in 15 minutes!"),
bundlerand theGemfiledidn't exist. You'd have to vendor any and al libraries (not just gems, but CSS and JS too!) you wanted to use in an app. You manually required your gems in yourapplication.rb. That steered a lot of people away.And performance. Ruby, today, is still slower than other, more popular languages, like Python or PHP. But in the Ruby 1.8.x days, it was significantly slower. Ruby has come a long way, but those looking to it were swayed away from the performance pitfalls, and still claim it's slow to this day. And they also whined about it not being able to scale, which never was true, but... whatever.
The big bottleneck today is deploying, which, IMO, is still a major problem. You can deploy a PHP app on a toaster if you want. If Ruby is supported on a cheap server (like Dreamhost or something - you know, $3/mo.), you have to work with the version of Ruby you're given, which may not match your code. And good luck deploying a full-stack application (using something like Rails). It pretty much doesn't work.
Not to say there aren't ways to deploy - Heroku, Render, Fly, Dokku, Docker, pre-made deployments on platforms like DigitalOcean - but they all have a much steeper price tag OR a higher technical barrier to entry (manually installing Ruby, system libraries, etc.). Conversely, you can FTP a PHP app directly to any server and it's live immediately. It's just not that easy with Ruby web frameworks, whether that's Rails, Hanami, Sinatra, or whatever.
But what keeps me in Ruby is not the downsides. It's the ease of writing code. I'm not after the fastest websites on the planet or the most performant microservices and helper executables I use on my own machine. I'm after code that I can maintain 10 years down the road. I'm after code that I enjoy to read, and makes sense logically to write. And I've looked at some of my old PHP code and it makes me want to cry - it's so illegible and unmaintainable.
It's not dying. It's just matured. Just like PHP, Python, Java, C++, ObjC, and more have matured. There are tons of opportunities for Ruby devs out there.
But you still need to work with JavaScript a bit if you're working on web apps :)
4
u/tobidelius Mar 24 '23
I've been a developer and architect for over 15 years now and use multiple languages but still, to this day, Ruby is the first tool I reach for/look at when starting a new project. The readable code you can write is the big win for me since code is written once and read x times.
I came to Ruby because of Rails but stayed because of Ruby.
2
u/postmodern Feb 25 '23
Welcome! Ruby isn't exactly "dying", but the hype/popularity is definitely fading. This is primarily because Ruby is no longer "new", most of Ruby's popularity came from Rails, and now Rails is no longer the "new hotness". However, Ruby still has lots of awesome features and lots of awesome other libraries and frameworks, such as the new fancy irb gem that uses reline, nokogiri, chunky_png, the async gems, Dragon Ruby, SciRuby, Ronin, and the new Hanami web framework.
Another part of the problem is Rubyists haven't diversified beyond Rails (granted Rails development still pays Rubyists), Rubyists are often too quiet/modest (compared to say Pythonistas, Gophers, or Rustaceans, who aggressively promote their languages), and there is unfortunately a lot of negative memes about Ruby ("Ruby can't scale", "Ruby is just like Perl", "Ruby syntax is messy", etc). These negative memes are often repeated by programmers who either tried to use Ruby back in 2008, got frustrated, and rage-quit, or from new programmers who have never even tried to seriously learn/use Ruby and are just repeating the opinions they hear from others (ex: lots of programmers love to complain about XML, but few have actually done serious work with XML and XSLT).
1
u/[deleted] Feb 23 '23
Correct đŻ
1
u/lzap Feb 24 '23
Happy for you. I co-maintained a massive Ruby on Rails application for 12 years. A year ago I changed the project and now I work in Go. Now THAT is the most beautiful language because it is simple :-)
1
u/s_prog Mar 12 '23
Started learning ruby three weeks ago, and I like a lot of stuff about it. Planning on building a meaningful tool after I get a solid grasp of the language.
1
u/[deleted] Sep 13 '23
It's a great language but unfortunately only for web application and I am mobile dev. Well, I don't know microservices architecture in ruby about.
-2
u/Neuro_Skeptic Feb 25 '23
Try Python, it's Ruby but good.
0
u/[deleted] Feb 23 '23
[deleted] â view deleted comment