Overview
This post discusses what someone who has experience with PHP and Go did to learn Ruby.
Approach
Official Documentation
First and foremost, start with the official documentation.
- What is Ruby
- Concisely describes the features of Ruby.
- For specifications you want to investigate deeply, this is a good reference.
- Ruby from Other Languages
- Describes the unique parts of Ruby's language specifications. It summarizes the points to learn that are not present in other languages.
- For specifications you want to investigate deeply, this is also a good reference.
- From PHP to Ruby
- There was no Go version. As a former PHPer, I referred to the PHP page. The content is quite straightforward.
- Ruby in 20 Minutes
- Perfect for a light practice.
- Object-Oriented Scripting Language Ruby Reference Manual (Ruby 3.3 Reference Manual)
- A reference manual by volunteers. Much appreciated.
Books
Picked up some classic ones.
- Fun with Ruby 6th Edition
- Ruby for Professionals
- Perfect Ruby
- cf. Perfect Ruby
- Perfect Ruby on Rails
- Although it's a framework, if you're doing Ruby, you'll likely have opportunities to work with Rails.
- cf. Perfect Ruby on Rails
I also picked up some books related to object-oriented programming, but haven't had the time to read them.
Ruby Tips
Read through articles related to tips.
- Techniques for Writing Declarative Programs in Ruby
- Some Ruby Tips
- Ruby Competitive Programming Tips (Basics, Traps, Speedup 108 2.7x2.7)
- The content is substantial.
- Ruby's Unique Practices
- [Ruby, Rails] Tips for Refactoring (Beginner)
- Summary of Ruby Argument Types
- There are many types of arguments!
- I want to remember them while writing and reading code, as I can't memorize them all at once.
- qiita.com - Building a Web Framework in Ruby
- The Rails Doctrine: 8 Principles by the Creator of Rails
- What is Ruby on Rails and How to Deal with It?
- Ruby Memo, Especially Confusing Parts, Omitting Parentheses in Method Calls, etc.
- Modern User Authentication Model Structure Explained by the Author of Perfect Rails
- How DHH Organizes His Rails Controllers
Blog
Learned about language specifications that caught my interest and summarized them in a blog.
- About Ruby Symbols
- About Ruby Block Syntax
- About Ruby Proc and Lambda
- About Ruby Singleton Classes and Methods
- About Ruby Modules
Coding Quizzes
Solved coding quizzes for practice.
- HackerRank - Prepare > Ruby
- Worked on the Ruby tutorial.
I intended to solve some problems on LeetCode but skipped it due to time constraints.
Data Structures and Algorithms
Practicing data structures and algorithms is a good way to learn how to use the language.
Converted what I wrote in Go to Ruby. ChatGPT and Copilot provided significant support.
Design Patterns
Since Ruby is an object-oriented language, I practiced some patterns.
Referred to davidgf/design-patterns-in-ruby and transcribed a few.
Impressions
I was able to grasp the unique language specifications of Ruby, so now it's just a matter of writing code.
After learning, I felt that the verbosity of code can vary greatly depending on proficiency. While this is also true for PHP, it wasn't something I felt much with Go, so I might struggle a bit when reading code.
On the other hand, I got the impression that the simplicity in appearance and writing style is appealing.
Having been away from object-oriented languages for a while, I felt unfamiliar with handling classes, so I want to practice more.
Looking at the environment surrounding Ruby, being a domestic language, there are many Japanese committers, and the level of RubyKaigi is high, giving a sense of the community's enthusiasm. I expect there will be much to learn, so I want to continue improving.
The cultural aspect of different community atmospheres by language is quite fascinating.