Template Method Pattern In React

Over the weekend, I was reading a fantastic book on Ruby by Sandi Metz, Practical Object-Oriented Design in Ruby. In chapter 6 named Acquiring Behavior Through Inheritance, she mentioned the usage of the Template Method pattern. When I read the word “pattern”, I immediately thought of the book, Design Patterns: Elements of Reusable Object-Oriented Software. Without any pause, I grabbed that book from my bookshelf and started searching for the Template Method pattern.

Read More

this in JavaScript

this in JavaScript has confused many developers who started learning JavaScript. The most common reason is that it doesn’t behave the way you would expect if you come from an object-oriented language like Java or C#.

Read More

Cascade in CSS

Cascading Style Sheets, or CSS is one of three core technologies behind any basic webpage, the other two being Hypertext Markup Language (or HTML) and JavaScript.

Read More

Intro to React Hooks

Seems like React Hooks are all the rage these days so I thought it would be a good idea to do some guided learning on React Hooks.

Read More

Asynchronous JavaScript With setTimeout

I remembered when I first came across setTimeout() I didn’t think much about it. At the time, my naive mind was like “oh, so it does an action after a certain time, that’s not so hard”. For a long time, I kept seeing setTimeout() used in examples where asynchronous JavaScript was involved, whether it’s old school asynchronous callbacks or Promises. I never really thought deeply about why they were used until I came across this eye opening tech talk on youtube: What the heck is the event loop anyway by Philip Roberts.

Read More

Command Pattern in JavaScript

While reading the brilliant book by Addy Osmani, Learning JavaScript Design Patterns, I’ve ran into the Command Pattern. Before any further reading, I’ve turned to the book, Design Patterns: Elements of Reusable Object-Oriented Software. After reading the chapter on Command Pattern, it reminded me a lot of Redux.js and how its actions work. Actions in Redux are just plain old JavaScript objects that contains a “command” and optional data. I was so certain they were related that I googled “Command Pattern and Redux” and found this article titled Redux and The Command Pattern It’s fascinating how even new technology created in the last few years still have roots in tried and true design patterns. Just reinforces the fact that every software developer should have a solid understanding of design patterns.

Read More

Accessibility with labels

According to MDN: “Accessibility (often abbreviated to A11y—as in “a” then 11 characters then “y”) in Web development means enabling as many people as possible to use Web sites, even when those people’s abilities are limited in some way.”

Read More