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. (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 sihui.io. I share lessons… 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. class Pizza attr_reader :name,… 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. class StandardCarBuilder def build car = ” # 1. build car frame car << “This is a standard car\n” # 2. add an engine car << ” with an engine\n” # 3. add front wheels… 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

Design Pattern: Composite and Group Messaging

Design Patterns in life and Ruby – gain an intuitive understanding of OO design patterns by linking them with real-life examples.   The Composite Pattern gives the ability to treat grouped objects and individual objects the same. Let’s look at its definition:   A Real Life Example: Group Messaging Let’s look at the definition in light of group messaging. There are six people on my contact list: Mom, Dad, Uncle Bob, Cousin Nick, Aunt Julia, and Amy Kinser. The Parents group is composed of Mom and Dad, whereas the Uncle Bob’s Family group is composed of Uncle Bob, Cousin Nick, and… Continue reading