Why You Should Learn Ruby as Your First Programming Language
So you decided to learn programming. Everyone you know seems to be learning it in their free time and you heard that developers get paid a lot, so why not? If you were to do a Google search of which programming language to learn first, you would see a lot of articles suggesting Python, Javascript, C, SQL, HTML and the list goes on. The number of possibilities is definitely daunting, especially for anyone who hasn’t seen any of these words before. One language that is lower on the list, or not may not even be mentioned, is Ruby.
Ruby is a general purpose scripting language mainly used for web development, as opposed to low level programming. If you’re mainly interested in building websites, I will demonstrate why you should consider Ruby as your first coding language.
What is Ruby?
A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.
In 1995, Yukihiro “Matz” Matsumoto launched Ruby with the intention that programming should be fun and easy for humans to understand. Above all, the creator prioritized programmer’s happiness. Ruby’s popularity boomed in 2003 when David Heinemeier Hannson created Ruby on Rails, a Ruby server-side framework. In 2005, he demonstrated the power of Rails by building a blog engine in 15 minutes.
There are many sites that have been built with Ruby on Rails:
Pros of Learning Ruby
1. Easy to Learn Syntax
As this language was created to be close to the English language, Ruby is easy to write and understand.
2. Open Source
Ruby is free to download. There is also a multitude of free guides and tutorials on how to learn Ruby (see below for links).
3. Large Community
Ruby has been around for a long time, which means a plethora of forums to pour through if you’re stuck. On Stack Overflow, there are more than 220,000 questions posted using the Ruby tag. Somewhere out there, someone has already asked a question you have and received a solution.
4. Extensive Library
Due to its long history, there are many RubyGems that allow you to install libraries, sets of prewritten code, that you can use to build your personal projects. For instance, you can download RuboCop to check, or lint, and format your code. Another gem is pry-byebug, which helps to debug by executing code at set breakpoints.
5. Speed
Ruby, along with Rails, allows you to create products quite quickly. As mentioned above, Rails’ creator could make a blog engine in 15 minutes. This has made Ruby on Rails popular with start-ups as a Minimum Viable Product (MVP) can be produced and released to market quickly.
6. It’s Fun!
While everyone has their own definition of fun, Ruby was created with the intention to be fun to write. Coding is already difficult as it is, so at least it could be a little bit fun.
Cons to Learning Ruby
1. Abstraction
Abstraction can be defined as the removal of complexity by obscuring the “unnecessary” details or underlying processes to the user. This may lead to confusion or lack of understanding of what is going on while creating Ruby code.
2. Decrease in Popularity
As of April 2021, Ruby is the 13th most popular coding language according to the TIOBE Index. If you’re someone who’s intending to make a career switch into web development, Ruby may not be as appealing to learn as it as experienced a decline in popularity over the years.
3. Limited Use Cases
As this language is best suited to creating web applications, you may not be able to experiment with making other projects using Ruby.
4. It’s Slow
While the process of creating web applications might be fast, some opponents to Ruby may say that Ruby is a slow language. This may be due to its high memory consumption. However, this issue is more relevant for larger applications and shouldn’t be a problem with smaller projects.
For at least a couple of years now Ruby is no longer exciting. And it doesn’t have to be — in the long run I don’t expect programming languages to be exciting, I want them to be mature, stable, and reliable. And that’s how I see Ruby in 2019. Every year there are fewer areas in which I need to turn to languages other than Ruby. It’s not and I doubt it will ever be a true “enterprise” technology, but when you need to move fast and be flexible — Ruby will remain a great choice for the coming years. — Filip Tepper, Senior Engineer, Castle Intelligence
Final Words
As you can see, there are pros and cons to learning Ruby. But at the end of the day, it doesn’t really matter too much on which language you choose to learn first. Many concepts that are introduced when learning Ruby, such as variables, methods, loops, conditionals and arrays, appear in other languages. By already familiarizing yourself with these concepts, it becomes easier and easier to learn other languages. As a budding developer, Ruby could be your first programming language, but definitely not your last.
References and Further Reading
- Pros and Cons of Ruby Software Development
- Top 21 Famous Websites Built with Ruby on Rails
- 53 Best Ruby Gems We Use at RubyGarage
- Python vs. Ruby: A Comparison of Differences and Similarities
- 7 Reasons Why You Should Learn Ruby on Rails
- Pros and Cons of Ruby on Rails
- Ruby vs. Python: Choosing Your First Programming Language
- A Complete Guide to the Ruby Programming World
- What are the Most Common Applications of Ruby?
- Why Ruby on Rails Is Still a Good Choice in 2021