Searched for ""

Design Pattern: Adapter and Power Adapter

Design Patterns in life and Ruby — gain an intuitive understanding of OO design patterns by linking them with real-life examples.   The Adapter Pattern is very easy to understand because we interact with it every single day.   If we search for adapter images online, we will see lots of real-life examples using the Adapter Pattern.   Type C to Type A Power Adapter Let’s take a closer look at one of these real-life examples — Type C to Type A Power Adapter. The Type A electrical outlet plug is widely used in the US, whereas Type C is widely… Continue reading

Design Pattern: Command and Concierge

Design Patterns in life and Ruby — gain an intuitive understanding of OO design patterns by linking them with real-life examples.   The Command Pattern’s definition is a stressful one to look at.   Let’s forget about it for a second and take a trip to Hawaii. And live in a luxury hotel.   We spent the day on the beach, scuba dived, and did some sightseeing. It’s time to get back to the hotel to chill, eat, and plan for the next day.   After getting back to the hotel, we want to: Get room service for dinner Get… Continue reading

Who are you? Self-awareness In Ruby

Understanding how self works is critical in reading Ruby code. If you ever feel confused or lost when reading a piece of Ruby code, exam what is self in the current context might get you back on track. It’s one of those things that once you get it, many Ruby codes will start making sense to you. This article explains: what is self how to determine self What Is Self? Being the default object of the current context gives self two privileges. It is the default receiver of messages, meaning calling a_method is the same as calling self.a_method.  It is the owner of instance… Continue reading

Design Pattern: Singleton and YOU

Design patterns in life and Ruby — gain an intuitive understanding of OO design patterns by linking them with real-life examples.   This might be the most important post in my Design Pattern series because this one is about YOU. Before anything, you need to listen to this song: No, I’m serious. The song is less than 2 minutes. Listened to the song before you read any further. Let’s take a look at the lyrics of the song:   You’re in a class by yourself, you’re one of a kind, and you’re the one and only one! This uniqueness is… Continue reading

Design Pattern: Observer and Podcasts

Design patterns in life and Ruby — gain an intuitive understanding of OO design patterns by linking them with real-life examples.   If you listen to podcasts, you are already familiar with the Observer pattern. In fact, you are an “observer”. Here’s the definition for the Observer pattern:   Let’s look at the definition as related to podcasts. I find an interesting podcast named developer tea. After clicking the SUBSCRIBE button, I’m now on their subscriber list.   When developer tea releases a new episode, the Podcasts app will notify me and other subscribers and automatically download the new episode for… Continue reading

Stop Thinking Like A Developer. Think Outside-in.

TL;DR: Want to advance your career as a software developer? Putting all energy into learning technical topics is not enough. You need to think outside-in.   Finally, you landed your first software development job. It felt like a dream came true. Or at least it’s one step closer to your dream. Your career as a software developer just started. You are super excited and eager to learn and grow as fast as possible. You want to be like that ninja developer on the team who seems to know everything about programming. You are ready to put in some extra hours after… Continue reading

Design Pattern: Decorator and Waffle

Design patterns in life and Ruby – gain an intuitive understanding of OO design patterns by linking them with real-life examples.   The decorator pattern is about adding additional features to an existing object easily. Does that sound like French? No worries. We will come back to this later. Let’s take a look at some waffles first!   The genius part about waffles is that they start plain and simple. Because they are plain, almost everything tastes good with them. The most common toppings for waffles are strawberries, blueberries, blackberries, bananas, almonds, whip cream, Nutella, and syrups. If we try… Continue reading

Intimidated by the Official Rails Guides? Here is the Cure.

TL;DR: how to study and master the Rails Guides to level up and become an intermediate Rails developer.   It’s a bit embarrassing to admit that I was scared of the official Rails Guides. I much preferred video tutorials and blog posts over the official doc. Becuase video tutorials and blog posts seemed less intimidating and more hand-holding. I avoided the official Rails Guides like the plague. Whenever I saw recommended Rails resources, the Rails Guides was always on top the list. But I was so afraid of it that my brain would automatically filter it out and go check… Continue reading

How to Fail at Almost Everything and Still Win Big (WIP)

Main Concepts of the book: Build systems that increase your chance of success, instead of setting goals. Focus on building systems that no matter what’s the outcome of the things you do, you will learn and be closer to success. Focus on maximizing your energy. Focus on failing forward – learn the most out of your failures and move on. Stay optimistic. Keep things simple. That’s the best way to make sure they get done. Willpower is a limited resource. If something requires willpower, it’s more likely to fail. Don’t rely on willpower. Build habits and routines. Eliminate all the decisions you… Continue reading