Oct 20 2021

The useSelector Anti-Pattern

There are two common ways of accessing a redux store: either by connect or useSelector. I will discuss why I prefer connect and why you should too. Simply put, useSelector makes life unnecessarily difficult due to coupling.

Mar 31 2021

Separate Concerns with Higher Order Components

Higher order components (commonly known as HoC) are a great tool for separation of concerns. This pattern is highly encouraged in the React world and are commonly found in dependencies such as react-redux. A higher order component can assist in splitting UI from data sources and mutate functionality.

Dec 15 2020

Wireguard Configurations

Lately I’ve been getting more into the self-hosted game. This DIY approach has given me a much greater appreciation for good software. It doesn’t come without its drawbacks though. Self-hosting requires more time, responsibility, planning, and various chores: data back-ups, log monitoring, ensuring good up-times, etc. It’s not a hobby to choose lightly!

Nov 07 2020

The Best Way to Avoid Merge Conflicts

We all dislike merge conflicts. Even worse, convoluted merge conflicts that when improperly resolved, lead to regressions. What is the best action towards transforming a codebase into easy-to-resolve (or zero) conflicts? I argue for Separation of concerns.

Oct 28 2020

Law of Demeter: Always Encapsulate

Exposing internal data structures are bound to lead to a messy situation. When a method caller knows too much about an underlying system, there is a nasty kind of coupling. This dependency issue is relates to the Law of Demeter. Some people call it “too many dots syndrome” because it leads to code.accessing.attributes.very.deeply. The whole point is that the caller should not have knowledge of the deep attribute.

Oct 20 2020

JS Performance: Classes vs Function Composition

Today during lunch I wrote up a really quick benchmark comparing the performance of class instantiation vs function composition.

Sep 17 2020

Light as a Feather: Adding pagination

This will likely be the last article in the series of “Light as a Feather”. I hope you’ve enjoyed it so far! Let’s talk a little about pagination.