Ruby

How to start learning Ruby? (timeless resources and techniques)

It's a very short compilation of the resources I found most useful when I started to learn Ruby a year ago. Use them to start, continue, and get unstuck!
How to start learning Ruby? (timeless resources and techniques)
In: Ruby

You learn Ruby by writing Ruby. It all starts with getting your hands dirty, over and over again. Accompany your dirty hands with some good theoretical stuff and you are good to go. Here I present 4 crucial points to get started:

  1. Unit Exploration
  2. Integration Exploration
  3. Resources for learning & creating
  4. A process to get unstuck

Then at the end, I make a suggestion on how you could combine those points into your own curriculum to learn Ruby.

It's a very short compilation of the resources I found most useful when I started to learn Ruby a year ago. I see them over and over again as suggestions to people switching to Ruby or being completely new to it. I kept the number of resources very short because I know that you already have enough decisions to make in your life.

This is not a suggestion on how to learn Rails. This would be a bit more of a different post. It'd be cool if you dig into Ruby a bit and write some small projects from A to Z before getting into Rails. Once you've done that let me know and we will spin up a "How to start learning Ruby on Rails?" post ;)

1. Unit Exploration with IRB

I pop-open the IRB (Interactive RuBy) shell all the time. Here you can play around with the syntax, inspect the environment around you, and run Ruby meta-commands. Every learning process starts with curiosity, experimentation, and exploration. Whenever you read or think something interesting, spin up an IRB and try it out!

Just a few cool things.

2. Integration Exploration with Scripts

IRB is great when you learn and experiment and inspect things. But it's not so great for writing coherent pieces of code. Whenever you'd like to see how things play together write a script.

In Ruby, you've written a class and a few modules faster than you can say

Investitionsverwaltungsentwicklungsgesellschaft
An everyday German word.
# script.rb
module WordCounter
  def char_count
    word.size
  end
end

class Word
  include WordCounter
  
  attr_accessor :word
  
  def initialize(word)
    self.word = word
  end
end

word = Word.new('Investitionsverwaltungsentwicklungsgesellschaft')
puts("A normal German word has around #{word.char_count} characters 🤷")

And you've run your script faster than you can say blink:

~ ruby script.rb
A normal German word has around 47 characters 🤷

And then, you can also load your script into IRB and play around with the classes and objects:

~ irb
irb> load '~/script.rb'
A normal German word has around 47 characters 🤷
=> true
irb> Word.ancestors
=> [Word, WordCounter, Object, Kernel, BasicObject]
Your Word class is now available inside IRB, so play around with it!

The point is, you can experiment with a larger part of the language with a script. If IRB could be used to explore and inspect single Units, then scripts could empower you to do Integration Exploration.

You can also use a similar approach by writing tests for your Ruby files or web applications. Integration at its finest.

3. Accompany your Learning with Resources

Of course, you need inspiration and reasons for spinning up IRB or creating scripts. That's where resources jump in.

There are 2 types of resources:

  1. Resources that someone else created for you to learn
  2. Resources that you create while learning

Below are my personal opinionated preferences but I still think you will find them useful when you follow along. However, if you don't like any of those, maybe it's not worth sticking with them. Then just go to the next one or initiate your own research. There is tons of great material out there!

The resources presented here exist each for at least about 5-10 years already and they still will be useful for learning Ruby 3+ in the next 10 years or so (yes, that's a tough bet but I'm taking the risk 🂡🂢 cause it's suited).

Resources for everyone

No matter your developer experience level, you'll find this useful...

Chats and Forums

The ruby community is really outstanding. Having been active in the Java, Python, and JS communities, I have something to compare. The Ruby community is really something :))

Each community has its rules and guidelines. Get a feeling for them and participate!

Build toy and real applications

Find a tutorial that resembles your idea or something that you would really like to work at and follow along. If you feel confident, try to use the tutorial to actually build your own idea.

Work on your favorite open source project

I'm not too deep into the open-source world, but projects you can start contributing to right now independent of your experience level: exercism.io and ruby for good. Here's a useful compilation of everything open-source in Ruby.

Videos

Some Rubyists explain things in video form which can be a really helpful alternation for your learning muscles:

  • DriftingRuby
  • GoRails
  • RubyTapas
  • YouTube (duh)

Watch whatever is relevant for your current task at hand or take a course that psyches you out.

Resources for learning Ruby as a total beginner

Ruby resources for total beginners are rarer than those for people who already have their feet wet. I didn't start learning Ruby as a total beginner, but here are the things I see referenced all the time for being a great resource:

👨‍🏫 codecademy - always a great interactive primer for any programming language

📕 Learn Enough - to get you started with Ruby more softly, then you should checkout Hartl's Rails tutorial if you want to dig into web apps

📖 Learn Ruby The Hard Way (Book, videos, email support) - a step by step guide that kicks your ass if you prefer that style ;)

Bootcamps

Bootcamps have great materials to get you off the ground from 0 to the more advanced lands of Ruby and Rails. Check out these free bootcamps:

🌬 The Odin Project - Great open-source materials and community

👩‍🎓 AppAcademy - High-quality Bootcamp material for free

Resources for learning Ruby as an experienced developer

👨‍🏫 exercism.io - You will love it for learning to write idiomatic Ruby in direct conversation and a mentoring relationship with other developers

🧘 rubykoans - unlock the koans by writing tests while learning Ruby concepts

📖 books - Eloquent Ruby or Well-grounded Rubyist (if you have more time) and Ruby Under a Microscope to get deep into the internals

4. Have a process to get unstuck

With the tools above you are well-prepared to max out on your learning by getting out of your comfort zone and building something new, maybe even something extraordinary. In other words, you are well-prepared to get stuck ;)

Getting stuck can be scary. You could start to question your intelligence and the purpose of life. Before doing that, though, try this process in this particular order to get yourself unstuck. If this doesn't help, let me know! (I hope to hear from 0 people about this, but I'm up for the challenge ⚔)

a) Think and dissect

  • Inspect what's happening (e.g. IRB), try to understand all the inputs and outputs
  • Isolate the moving parts into their own methods and write tests for how you expect it to work
  • Redo everything step by step since the last time that it worked well
  • Rubber duck

b) Search

Probably you'll have googled it for a bit already by this point in time, but try to phrase it differently. Also try to look for the issue directly in StackOverflow or on Reddit.

c) Videos

In the video hubs, that I mentioned above, search for the topic that could offer the solution if you understood it better.

d) Ask

I wouldn't have made it into programming without other people. Ruby has a wonderful community of developers who do just that: help other people. As your last resort, now that you explored all the possibilities of your current challenge, you can explain it in detail in one of the communities above. If your issue is general enough, consider posting it on StackOverflow or Reddit.

Your getting-started curriculum

Whatever you decide from this list: Pick something and make a weekly plan of how you'll go about it.

Don't be rigid about what you want to finish on which deadline but rather block time to work on the stuff and give yourself time to understand things. That's certainly one of my weaknesses: I want to get stuff done quickly and move on to the next thing, but I am often reminded that deep understanding goes a long way when I dig deeper into something or write about it.

Pick a combination of things if time allows for it. For example, if you do some coding challenges, ask for feedback somewhere (exercism.io or in communities). While you are waiting for the feedback, create something with your own project or tutorial. Then before bed read a chapter from a Ruby book. All those things will reinforce each other and you will inevitably build rubynian pathways in your brain.

And don't forget to spin up the magic IRB shell, tests, and scripts to play around with things that you find noticeable and to break them along the way (better break them in IRB before they sneak as nasty bugs into your apps ;)

Comments
More from RichStone Input Output
Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to RichStone Input Output.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.