Photo by CDC on Unsplash

A large part of programming is writing tests to make sure your code works as expected. On smaller projects writing tests can seem cumbersome but they will show their value as features are added, modules are refactored, and the team grows. Most software engineers are familiar with the basic testing types such as unit tests, integration tests, and acceptance tests. Today I wanted to talk about keeping unit tests hermetic to ensure they remain unit tests instead of becoming integration tests.

Hermetic is often associated with clean room laboratory but in the world of software it refers to tests which…


Photo by Yancy Min on Unsplash

Git is an extremely useful tool that has become almost ubiquitous with programming itself. Unfortunately, learning it can be a bit overwhelming with the seeming endless git documentation. Eventually everyone masters manipulating and merging branches on small projects but as repositories grow in size as well as contributors things can get complicated. Fortunately git is excels on large projects and has many advanced commands which allow you fix almost any mistake you make, the key is knowing which commands to use in which situation. …


Half of Being a Great Engineer is Quality Documentation

Photo by Stellan Johansson on Unsplash

The ability to convey your thought process, assumptions, approach, and solution to a given problem is a fundamental skill in engineering. There are numerous tools available for documentation but one used often in the world of software engineering is Markdown. Markdown is a lightweight markup language for creating formatted text using a plain-text editor. Unlike other popular markup languages such as HTML, Markdown is designed to be easily human readable. I find myself using Markdown on a daily basis via Github for pull requests, comments, READMEs, etc and I have found the following syntax useful. …


Data Structures in JavaScript

Photo by niko photos on Unsplash

A binary tree is a specific type of graph data structure and is often the first graph people learn. Binary trees contain a root node that has two branches which are arranged from left to right in ascending order. Each branched node can have up to two branches of its own, and so on. If these two requirements are not met then the data structure is likely still a tree, just not a binary tree. For instance, if a node had three branches it might be considered a ternary tree. This article will cover only binary trees as they are…


Data Structures in JavaScript

People Queue
People Queue
Photo by Halacious on Unsplash

Every person has waited in a queue, whether it is at the grocery store or to get into you favorite concert. A queue’s operation is simple and intuitive, you get in the back of the line and wait your turn until your in the front of the line before exiting the queue. This is the same way the data structure of a queue works.

Node Class

In the person queue analogy, each person can be considered a node that contains some data and points the the next node. …


Data Structures in JavaScript

Stack of Pancakes
Stack of Pancakes
Photo by nikldn on Unsplash

There is nothing better than a stack of buttermilk pancakes to calm that early morning sweet tooth. Now, I normally slice through the whole stack and eat a bit from each pancake at once but lets pretend, for the sake of this discussion, that I am a reasonable person that eats a single pancake at a time. To do so, the top most pancake would be pulled off of the stack and consumed followed by the next pancake on top. This is the same way the linear data structure of a stack works. …


Data Structures in JavaScript

Photo by Jon Tyson on Unsplash

In the previous “Data Structures in JavaScript” discussion, we walked through the methodology used to construct a node class which represent each “link” in the “chain” that is a linked list. From there we discussed how to construct a singly linked list from a an array. Building on the previous discussion, we will now dive into editing that singly linked list. If you are not familiar with the code and terminology covered in the previous article it is recommended you review Building a Singly Linked List.

With a linked list there are three ways to edit the list: update a…


Data Structures in JavaScript

Photo by Stephen Leonardi on Unsplash

Most likely you arrived at this article because your preparation for an interview has lead you down a LeetCode rabbit hole. Linked lists are a favorite of many interviewers to test an interviewees understanding of basic data structures as well as your problem solving skills. Whether you're just a bit rusty from school or this is your first time encountering linked lists they can be a bit tricky to understand at first.

As with most problems it is helpful to start with a diagram. A linked list is a linear data structure which can be thought of as a chain…


Photo by Tianyi Ma on Unsplash

In Java, enumerables or enums for short, are a special type of class that represents a group of related constants. For example a list of the days of the week or a set of Redux action types are good candidates for a enumerable. These can come in handy when your code references these group of constants but you want a single source of truth. In addition, enums improve readability via documenting the intent of your code. Vanilla JavaScript does not have enums but they are available in the superset of JavaScript, TypeScript version 2.4 and on. …


Photo by Photo Boards on Unsplash

As I continue the Udemy course TypeScript: The Complete Developers Guide I’ve been introduced to several new to me concepts. Generics & abstract classes are two tools a developer can use to make their code more reusable and maintainable. More senior developers who are accustomed to strong type languages such as C, Go, Java and Swift are likely already familiar with these concepts.

Generics

As discussed in Typescript Type Declaration when declaring functions the input and output types should be annotated but what if you don’t know what type your input or output will be? Initially it may sound like this…

Mathew Phillip Wheatley

I am a software engineer with a mechanical background. Interests swing from aerospace, to woodworking, travel, skiing, hiking, running, climbing, and lasers.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store