TypeScript - Taking The Magic Out of Magic Strings

What’s so Magical About Magic Strings? Magic strings are string literals strewn about a code base that apply some kind of limitation to the code. They can be used to filter valid input, constrain parameters, or control the behavior of code. They are often considered an anti-pattern due to how to they introduce the potential for bugs when typos occur, or by the difficulty they create when the need to change a magic string occurs.

Continue reading ↦

Launching a SaaS - Part 1 The Landing Page

Overview This is the first part of my blog series about launching a Software as a Service (SaaS) product. I intend for this series to be a collection of the lessons I’ve learnt along the way, and is meant to be an educational experience. Because learning new things is one of my motivations there will be times where I explore DIYing portions of the project that should typically be offloaded to a third-party.

Continue reading ↦

Software Design - Symptoms of Bad Code

Admit it, we’ve all written bad code at some point in our software development careers. One could even argue it’s perfectly acceptable to write bad code when the situation calls for it. Bad code is perfect for cranking out minimum viable products, or implementing a last minute fix for a critical bug in production that has management breathing down the back of your neck waiting for a solution. The catch-22 however, is that bad code should only be brought to life when it will have a life-span so short that death is already looming in the shadows waiting to snatch it.

Continue reading ↦

TypeScript - How To Set Up A New Project

Summary For beginners TypeScript is like the carrot on the end of the stick, always just out of reach no matter how hard you try. Everyone touts how it’s “JavaScript that scales”, and once you use it you’ll never go back. But finding a decent tutorial on how to set up a new TypeScript project is quite the challenge. Many tutorials are out-dated and want you to install other packages such as gulp, jump through hoops, or even sacrifice your first born child (okay maybe not but still).

Continue reading ↦

Software Design - Abstraction

The Less You Know, The Better Do you think the automotive designers who carefully crafted each body line and roll of your car’s chassis cared about the engine’s cylinder bore or stroke? Or perhaps the firing order, or whether the engine had 2 spark plugs per cylinder akin to Chrysler’s hemis? Of course not, all they cared about were the more important details such as dimensions, mounting positions, electrical connections, and plumbing points.

Continue reading ↦

Software Design - Marker Interfaces

What Are They? A marker interface is an empty interface (no methods or properties) that is used to identify classes that implement it belong to a special group. Some might argue that this is a code smell, but in certain situations they can be the best solution for constraining types. It should be noted that the purpose of marker interfaces is a perfect job for the decorator pattern. However, in some languages (C# for example) attributes lack the support we need to implement a quick solution.

Continue reading ↦

Software Design - Magic Numbers

What Are They? Magic numbers are numbers in code that appear to be arbitrary, but actually serve a purpose. They are commonly described as an anti-pattern as they diminish code quality, and are “referred to as breaking one of the oldest rules of programming, dating back to the COBOL, FORTRAN and PL/1 manuals of the 1960s”. [1] However, this does not mean that all constants should be blindly replaced with pre-defined constants.

Continue reading ↦

Cherokee Build - 10/26/18

Finishing Up With winter approaching fast, and my Civic only having summer tires I needed to hurry up and finish the Cherokee. The Civic was also suffering from a stuck open thermostat that ensured the engine temperature never reached operating temp, and my heat was always cold. The funny thing is, when I was preparing to drop the B20B engine into the Civic I clearly remember thinking how pointless it would be to replace the thermostat.

Continue reading ↦

Cherokee Build - 10/21/18

Patching Holes This post is a continuation of the mini series about restoring my old XJ cherokee. In the previous post I talked about cutting out and welding in a new rocker panel. Initially the plan for this weekend was to finish welding in the new driver side rocker panel. However, I managed to screw up trimming it to fit and had to order another replacement which wont be in for about a week.

Continue reading ↦

Software Design - Dependency Injection and Inversion

What are they? While it may seem like nothing more than buzz words, dependency injection is a well known principle. In fact, you’ve likely used it yourself in the past and just didn’t know the technique had a name. Dependency injection can be thought of as passing a resource required by a class to the class through one of several means. While the class could instantiate a new instance of the resource itself, by using dependency injection we introduce an easier way to take advantage of dependency inversion.

Continue reading ↦