Post

Falling in Love with Ruby - First Impressions with The Odin Project

Hi! If you read my previous article about why I chose Ruby you know why I didn’t follow JS even though it was still deep in my memory after finishing the Calculator project and the whole Foundations from The Odin Project.

Introduction to Ruby with The Odin Project

I have to tell you that I couldn’t wait for that moment and was super excited to learn Ruby and to really see how Yukihiro “Matz” Matsumoto managed to make it so programmer-friendly as many say.

Getting Started: Ruby Installation and Documentation

Firstly I had to install everything and it wasn’t difficult with TOP guide.

After a short while everything was set and ready to go. Firstly I was introduced to Ruby documentation that looked a little bit different than JS one. (What would I expect though?! It’s a different language! :D)

It took me some time to get used to that. Especially when it comes to all methods and classes. At that point, I could tell the OOP lesson was approaching because it seemed different from what I was used to.

Once you get the hang of everything, it becomes really easy to find the information you’re looking for. The next step was to learn what IRB is. It is a Ruby interactive model that lets you type your program in the console and run it without creating any files. Very useful thing that Rubyists use all the time and I liked it since the beginning as I didn’t need to open browser to check my code every single time like I was doing with JS.

Tackling the Basics: Data Types and Initial Challenges

After I was sorted with all those I was ready to tackle basic data types and after a couple of Pomodoro sessions my hype began to slow down. Why? It felt super boring!

img-descriptionBasic Data Types

I felt as if I was doing JS from the beginning. I thought I’d done this before, so why waste time doing the same thing again? I understand that I am learning a new language and I need to start from the basics but c’moooon!

Overcoming Boredom and Staying Motivated

I’ll admit, I was a LITTLE disappointed at first, but I had no choice but to stick to the plan and carry on.

I knew it would get more exciting at some point but I was only afraid to don’t lose motivation. Why would I? It took me already so long to get to this point that there is no chance I am stopping or changing my mind.

I didn’t want to fight with my thoughts any longer at this point and just decided to put in more hours and focus harder as procrastination started to crippling in especially between my Pomodoro sessions.

The next lessons were about conditionals, loops, arrays, hashes, methods, and debugging. I cannot say it was the most exciting time and at this time I missed making some projects. I felt as if I was forgetting how to write code while learning how to write code. Strange isn’t it? I hope that you know what I mean and maybe there are more of you who had the same struggles.

I then approached Basic Ruby Projects and this news made me happy. I was finally able to give it a try and solve some bigger exercises like I used with Java Script some time ago.

img-descriptionBasic Ruby Projects

Well, I can’t remember how long it took me to finish them but it wasn’t too long before I got back to TOP lessons.

From Basics to Object-Oriented Programming (OOP)

The next one was Object Oriented Programming which I couldn’t wait for. At that moment I knew what it was going to be all about, more or less, and was eager to try it. Moreover, I was really curious if it’s so difficult to grasp as people sometimes say.

Since then, I planned to push through the curriculum faster during the weekends but something was always stopping me like my car broke and I had to buy another one as it wasn’t worth repairing my old one. Shortly after my family wanted to visit me and we were planning to go to Scotland for a week. I knew already that the time I wanted to spend on learning was limited that month.

img-descriptionTrip to Scotland

When we were there, I did my best to learn Ruby for 1 hour a day at least. After we came back and I dropped my family at the airport, my friend from Birmingham came to me for the weekend as he needed me to give him a hand fixing garden furniture he produced and sold to clients not far away from where I live.

img-descriptionSetting up garden furniture

On top of that my newly bought car decided to start leaking and to save up money I decided to fix it myself over another weekend.

img-descriptionFixing car

Guess what…

By this point, I had already lost three weeks of productivity. I was a little bit mad and scared that I wouldn’t be able to get my routine going again but fortunately, it seemed to start picking up nicely after I started again.

I continued with OOP which didn’t seem to be difficult. I could see the clear, organized approach, and I really liked it! I knew, however, that once I got to 1st bigger project using this, I would probably be stuck and have to return to these lessons. Well, that’s learning, isn’t it?

Ruby vs. JavaScript: My Favorite Ruby Features

Apart from time management, I knew Ruby was a great choice and even though I still had JavaScript syntax in my brain I could see how rewarding Ruby is. It was so easy to see how things are done in Ruby and I can promise you that if you decide to learn this you will have plenty of AHA and ‘’why couldn’t it be implemented to JS?!” moments.

Look at these examples I liked the most so far:

Range Operations:

In Ruby it’s super simple!

1
(1..5).to_a

And now look at JavaScript:

1
let range = Array.from({length: 5}, (v, k) => k + 1);

Symbol vs string usage in hashes

Ruby again makes it easier to read especially in large objects:

1
user = { name: "Alice", age: 25 }

JavaScript:

1
let user = { "name": "Alice", "age": 25 };

Another example is a case statement

I loved it since I found out about this for the first time. I finally didn’t need to use console.log which was quite annoying

1
2
3
4
5
6
7
8
case language
when "Ruby"
  "Great choice!"
when "Python"
  "Not bad!"
else
  "Consider Ruby!"
end

Javascript

1
2
3
4
5
6
7
8
9
10
switch (language) {
  case "Ruby":
    console.log("Great choice!");
    break;
  case "Python":
    console.log("Not bad!");
    break;
  default:
    console.log("Consider Ruby!");
}

Tips for Staying Motivated on Your Coding Journey

It took more work to get to this point of The Odin Project. I would even say that the whole Foundation was easier than the beginning of Ruby.

However, after these many lessons, my willingness to learn more has returned and I want to push further. I also stopped procrastinating so much.

If you are in a similar place with your learning schedule and feeling tired and thinking about doing something else I encourage you to don’t give up! Really! Maybe it sounds blatant and I might sound like a cheap coach or something but it works. At the moment of writing this article, I am working on a Mastermind project and it is fun.

Tic-Tac-Toe helped me to refresh all my knowledge about OOP and it seems like Mastermind feels much more fun as at this point I know how to solve many problems. Keep going, everything will click at some point!

I’ll keep you updated after I’m done with another challenge.

This post is licensed under CC BY 4.0 by the author.