Coursera Rails Module 2 Notes

| ruby | programming | learning |

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 for false 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. I also finally understand how blocks in Ruby (closures) work. (After many years of derping through Vagrantfiles)

Object Oriented Ruby

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 mastodon or via email.

Check out some more stuff to read down below.

Most popular posts this month

Recent Favorite Blog Posts

This is a collection of the last 8 posts that I bookmarked.

Articles from blogs I follow around the net

Script Doctoring

I’ve been having a number of communications problems in my interactions with my doctors at Kaiser lately, and it’s becoming one of those things where the burden and onus entirely is placed upon me to sort out, and that’s exhausting for the actually autist…

via Bix Dot Blog October 22, 2024

Blockchain company Forte acquires games studios, demands secrecy, shuts them down

Sometime in 2023, blockchain firm Forte acquired game studios Phoenix Labs and Rumble Games. However, it would be a year before this came to light, because according to a report from Game Developer, Forte demanded secrecy from employ…

via Web3 is Going Just Great October 22, 2024

Initial explorations of Anthropic's new Computer Use capability

Two big announcements from Anthropic today: a new Claude 3.5 Sonnet model and a new API mode that they are calling computer use. (They also pre-announced Haiku 3.5, but that's not available yet so I'm ignoring it until I can try it out myself.) Comp…

via Simon Willison's Weblog: Entries October 22, 2024

Generated by openring