Coursera Rails Module 2 Notes
Intro to Ruby
This module goes through a general introduction to Ruby. One thing that I find interesting is how optimistic Ruby is, in the sense that everything except forfalse and nil is true. This is especially interesting from the perspective of comparing true and false in sqlite where sqlite stores 0 as false and 1 as true. I have not had to deal with this yet, but it is nice to keep in mind going forward. Another nice thing that I have not used that much is irb this is basically a Ruby repl that allows you to quickly test out concepts in your shell. I also love (since I work at a CI company) that the very first lesson about ruby talks about rspec and even has us use it go grade our assignments. It is never too early to start thinking about tests.
Tour of Ruby Data Types
The next module took a nice tour of Ruby data types. I learned some pretty neat things.- Strings in Ruby super expressive, string interpolation is pretty amazing and very clean. Destructive Methods Have
!, I like this convention, you see it a lot in Clojure. - %w can make multiple strings into an array (like using .split() in JS)
- You can get a random element from an array with
.sample, pretty neat - Hash Order is maintained, this is really powerful
Object Oriented Ruby
- All methods public by default
- Clean class creation with useful helper methods for getter/setter
- Talked about how most of the functionality in Collections comes from using the Enumerator mix-in, gave an example of how to use it, super powerful!
Unit Testing
Again, I love that this course started right off the bat talking about unit testing. A+ to the course creators for covering this topic. The instructor did a good job talking about the differences between Test::Unit, MiniTest, and RSpec with great examples of how to use all of them.Assignment
The final assignment for this module was to write a program that reads a file and calculates word frequency. Overall it was pretty simple, I think the material did a good job preparing us for the task, and caused us to use a lot of the different tools that we learned about Ruby.Parting Thoughts
I have often heard that Ruby was designed for developer happiness. I really love the clean syntax, well documented API, and elegance. The next module will be a deep dive into Rails, looking forward to using more of the stuff that I have learned in this Ruby crash course.Thank you for reading! Share your thoughts with me on bluesky, mastodon, or via email.
Check out some more stuff to read down below.
Most popular posts this month
- 3 packs
- Coming of Age in the Craw
- Coursera Rails Module 2 Notes
- Growing the CircleCI Community with Discourse
- I sold all my shit
Recent Favorite Blog Posts
This is a collection of the last 8 posts that I bookmarked.
- DEP-18: A proposal for Git-based collaboration in Debian from Optimized by Otto
- [RIDGELINE] No Phones in The Ten-don Shop from Craig Mod — Writer + Photographer
- My next chapter with Mastodon from Mastodon Blog
- How many pillars of observability can you fit on the head of a pin? from charity.wtf
- The Software Essays that Shaped Me from Refactoring English
- Give Your Spouse the Gift of a Couple's Email Domain from mtlynch.io
- Skip the Next iPhone from Articles on Jose M.
- Have smart glasses finally hit an inflection point? from The Torment Nexus
Articles from blogs I follow around the net
Pluralistic: Meta's new top EU regulator is contractually prohibited from hurting Meta's feelings (01 Dec 2025)
Today's links Meta's new top EU regulator is contractually prohibited from saying mean things about Meta: It's one thing to hire an ex-Meta lobbyist, another entirely if she's signed a non-disparagement contract. Hey look at this: Delights…
via Pluralistic: Daily links from Cory Doctorow December 1, 2025Getting Warmer
ESA/Hubble & NASA, ESO/ Lutz Wisotzki et al The early Universe as seen by the MUSE spectrograph on ESO’s Very Large Telescope. So first the Big Bang happens. Everything is incredibly hot and dense; there are photons flying everywhere, but they keep coll…
via Brian Koberlein December 1, 2025Recently
This’ll be the last Recently in 2025. It’s been a decent year for me, a pretty rough year for the rest of the world. I hope, for everyone, that 2026 sees the reversal of some of the current trends. Watching This video from Daniel Yang, who makes spectacular b…
via macwright.com December 1, 2025Generated by openring