Searched for ""

How to Contribute to Ruby

Do you want to become a Ruby committer? Are you interested in learning from language designers? Do you want to get in the loop on conversations in the Ruby open-sourced development community? If so, this post is for you. Last week, I attended the Cookpad Ruby Hack Challenge. It was a one-day event where Matz (the creator of Ruby), Koichi and Mame (full-time Ruby committers at Cookpad) taught Ruby developers “how to extend Ruby features, fix bugs, and to improve the performance of Ruby.” Before the event, contributing to Ruby didn’t seem doable to me — I simply didn’t know… Continue reading

Ouch! That Code Hurts My Brain.

Notes for my talk in Rubyfuza 2018 and Bath Ruby 2018. (Click here for the video.) Welcome to this talk: Ouch! That code hurts my brain. Raise your hands if the following scenario sounds familiar to you. After a day of work, you feel exhausted and have a headache. You get back home feeling so tired that you don’t want to say a single word. You close your eyes and feel the pain inside of your head. Anyone? This talk is about how to turn code from brain-hurting to brain-friendly. I’m Sihui. I work at a startup called I blog at… Continue reading

Design Pattern: Prototype and Pizza

Design patterns in life and Ruby — gain an intuitive understanding of OO design patterns by linking them with real-life examples. The prototype pattern is the last creational pattern we will look at in the series. Here is its definition: Before we dive into the details of the pattern, let me tell you a story about a pizza store. Once upon a time, a wise young lady, Sihui, owned a minimalistic pizza store. The store only offered three types of pizza: pepperoni pizza, chicken pizza, and cheese pizza. The code for the Pizza class was straightforward. View the code on… Continue reading

From Hello World to Six Job Offers From Facebook, Airbnb, Salesforce…

I first came to the U.S. for college in 2012 knowing nothing about programming. Three and a half years later, I received six software engineering job offers, from Facebook, Airbnb, Salesforce, Gusto, Bloomberg, and Groupon. I want to share my story because I’m sick of the illusion that programming is complex, difficult, and only for smart, young kids. I’m tired of how all programing stories start with: “I started to code when I was 6 and then built my first video game…” My story is different. It’s the journey of how an average person went from knowing nothing about programming… Continue reading

Design Pattern: Builder and Car

Design patterns in life and Ruby — gain an intuitive understanding of OO design patterns by linking them with real-life examples. The builder pattern is a very commonly used pattern. But its definition can be a bit confusing at first glance. Fear not. The definition will become much clearer after we build some cars. 🚗 🚙 🚓 🚃 Let’s start by building a standard car. View the code on Gist. To keep our example simple, we will only pay attention to car frames, engines, wheels, dashboard, and energy sources and ignore the rest. The builder is easy to use. Let’s… Continue reading

Design Pattern: Proxy and Agent

Design Patterns in life and Ruby — gain an intuitive understanding of OO design patterns by linking them with real-life examples. Imagine yourself as a movie star, a big one. You are so famous that everyone in Hollywood wants to work with you. You never lack acting opportunities. So many requests come to you that you need an agent to handle them. Here is what you want your agent to do. When a new filming request comes, the agent first checks to see if it fits your schedule. If so, the agent then checks your preferences. (For example, you have… Continue reading

Design Pattern: State and Combination Locks

Object-Oriented Design Patterns in Life Series – gain an intuitive understanding of OO design patterns by linking them with real-life examples.   The State Pattern is a beautiful example of how combining simple classes with clean interfaces can produce great power. This is a long post. But stay with me. We are going to witness the beauty and power of object-oriented design together. Build a combination lock We will learn the State pattern by building a combination lock. According to WikiHow, opening a combination lock involves three steps: Spin the dial three times clockwise to clear any previously entered numbers… Continue reading