Extract Error Strings

Extract error types (and their message templates) into a separate file for cleaner code. The code examples in this article are written in JavaScript because that's what I'm most familiar with, but the principle applies to any language. handle-user-input.js: const handleUserInp…

The Finer Points of Unit Testing

What follows are a list of language-agnostic principles and best practices I have found to be quite helpful when writing unit tests. Let me know what I missed in the comments! This article was inspired by the knowledge-base I've been developing lately. It's sort of a living car…

Design Patterns with Functional Programming

Over the last decade, the software industry has slowly been moving away from classical-inheritance in favor of more compositional patterns (mixins in Ruby, traits in Scala, etc.) and its begs the question: what happens to the OOP design patterns we've all come to know and love (o…

React Abstractions: Part 1

Render Props, Component Injection, Higher-Order Components, and More! This set of articles is an attempt to organize my thoughts on these constructs and hopefully help others along their journey through the wonderful world of React. Part 1 will be concerned with the "What&q…

React CSS Modules Evaluation

tl;dr: Use "css-loader" over "react-css-modules"/"babel-plugin-react-css-modules" because the latter relies on side-effects, adds cognitive overhead (too much magic), causes React errors in your tests, requires complex webpack config, requires an add…

2