Searched for ""

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.   Related post: Singleton Pattern Deep Dive: Why is it bad?   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… 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

Frustrated Learning Rails? Here is What You Should Do.

You were new to Rails, Web Development, or even programming. But you decided to give Rails a try. You thought it might be challenging but doable, like climbing a hill. Unfortunately, as you spent more and more time with Rails, things got more and more confusing. Each time when you were stuck and searched for a solution, you encountered some new words: Bundler, MVC, ERB, TDD, ActiveRecord Associations… There were conventions after conventions. You felt all you did was googling and copy-pasting and had trouble gluing all the components together. You started to lose confidence and wonder if you would ever learn Rails or… Continue reading

Design Pattern: Simple Factory and Cheesecake Factory

Design patterns in life and Ruby – gain an intuitive understanding of OO design patterns by linking them with real-life examples.   Factory Patterns are about encapsulating object creation. But before diving into details of these patterns, let’s talk about cheesecakes. Because cheesecakes are about … happiness! Let’s focus our gaze at six of my personal favorites: Original Cheesecake, Ore0 Cheesecake, Coffee Cheesecake, Tiramisu Cheesecake, S’mores Cheesecake, and Hazelnut Cheesecake. Here is how we make a cheesecake: def make_cheesecake(type) cheesecake = nil case type when ‘oreo’ cheesecake = OreoCheesecake.new when ‘coffee’ cheesecake = CoffeeCheesecake.new when ‘tiramisu’ cheesecake = TiramisuCheesecake.new when… Continue reading

Design Pattern: Template Method and Chipotle

Design patterns in life and Ruby – gain an intuitive understanding of OO design patterns by linking them with real-life examples.   Template Method is the most commonly used design pattern in programming and real life. Before we dive into details of the pattern, let’s learn an important life lesson: Chipotle 101: How to Order in Chipotle. There are four steps involved: Choose a “vessel”: Burrito vs. Bowl vs. Tacos vs. Salad Add meat: Chicken vs Steak vs. Barbacoa vs. Carnitas vs. Vegetarian Add toppings: Tomato vs. Corn vs. Green Chili vs. Red Chili Add extras & drinks: Chips vs…. Continue reading