Why I Love Ruby and Why It's Good for Beginners

Posted by Veronica Lopez on January 26, 2020

Since graduating from Flatiron’s software engineering program, I’ve had a little more time to put some of my focus back on Ruby rather than just on JavaScript/React. While JavaScript is wonderful, fast, and perhaps more widely used, Ruby was my first love! That may be partly because it was a little easier for me to learn but also because of it’s flexibility, it’s testing infrastructure(which is what I currently need to focus on), and how it allows you to write Object-Oriented and/or Procedural code. I love the syntax, I love aimlessly playing around with Ruby code, and all of the fun concepts; the possibilities are endless!

  • Classes - Where you can create objects! An object is an instance of a class.
    class Cat
    end
    
  • Creating Objects
    cat = Cat.new
    
  • Ruby Methods
    class Cat
    def who_am_i
      puts "My name is Monty!"
    end
    end
    

    You can call the method like so:

    cat = Cat.new
    cat.who_am_i
    

This is some stuff I wanted to show you in case you’re a beginner. It makes a lot of sense and it’s not terrifying to read so if you’re thinking about learning Ruby, especially as your first language, I highly recommend it!

The Ruby on Rails framework, in my opinion was really fun to learn. It makes making web applications easier. The rails console is an awesome place to escape when you want to learn new concepts or debug and as Avi explains it: “It’s a brand new empty universe where you can create anything you want”. The MVC (Model-View-Controller) structure helps to make sure your code is organized and runs smoothly by separating the data, logic, and display layers of your app. When learning to code, you always want to try to make sure your code is DRY, which means Don’t Repeat Yourself. This helps ensure you’re not wasting time writing more code than you need to and also makes it easier to go back and debug in case something goes south.

There are certainly some concepts that are a lot harder and that I need to revisit which is why I am so excited to be able to spend a lot of time with it again. I want to put a lot of my focus on learning how to write tests because I didn’t have much time to learn them during the program and they weren’t required for projects. I also want to build more web apps because it’s certainly the best way to keep learning. YouTube tutorials were also a pretty big help for me just because I could physically see things being done and it boosted my confidence when coding on my own.

For now, I’ll be spending a lot of time with Ruby and I’m stoked about it!

Peace, Nica