• Binary Search Explained with JavaScript

    In this post, I’ll compare linear search and binary search algorithms. You’ll see pseudocode for each algorithm, along with examples and a step-by-step guide to implementing each.

    Read more
  • Understanding the Composite Pattern with JavaScript

    The composite pattern as explained by the Gang of Four is a design pattern which allows you to “compose objects into tree structures to represent part-whole hierarchies.” If you want to have a better understanding of how your favorite frameworks work or learn to build your own view framework, this pattern is the place to start.

    Read more
  • Getting Started with Recursion for Tree Traversal

    Have you ever encountered a problem you felt could be solved with recursion, except you didn’t know where to start? Or did it seem like you had to hack your way to a solution? The first part of tackling recursion is understanding when a problem calls for it.

    Read more
  • Strategies for Managing Application State Part 2

    Previously, I wrote about using the state pattern to manage application state. We will build on this idea with finite state machines. A finite state machine is a way to model state transitions in a system.

    Read more
  • What's in a Theme?

    A look at themes, what they include, some of the more common ones, and how they can help your web app development effort.

    Read more
  • Strategies for Managing Application State Part 1

    What is state? An object’s state is its data, its properties. For a book object, the state could include the title, author, and ISBN code. For a customer object, the state could be a first name, last name, and address. There is another use of the word state that applies to an object’s condition.

    Read more
  • Using Iterators and Generators in JavaScript to Optimize Code

    If you need a better way to manipulate large lists in JavaScript, iterators and generators are an improvement to using loops. Learn all about them in this tutorial.

    Read more
  • Understanding Recursion With JavaScript

    Some problems are more naturally solved using recursion. For example, a sequence like the Fibonacci sequence has a recursive definition. Each number in the sequence is the sum of the previous two numbers in the sequence. Problems that require you to build or traverse a tree-like data structure can also be solved with recursion. Training yourself to think recursively will give you a powerful skill to attack such problems.

    Read more
  • Structuring a React App for a CMS

    In this post, I will show you some suggestions for structuring and organizing the front end of your app. Whenever I start working on a project, I like to scaffold it with some files and folders. The create-react-app cli is a good starting point. However, it only provides the bare minimum for what one would need to create a project.

    Read more
  • Inheritance and Extending Objects With JavaScript

    If you are familiar with object-oriented programming, you are most likely familiar with subclassing and inheritance. However, inheritance has been getting a bad rap. I believe that is because some developers see it as a catch-all solution when you need to modify a program. The problem with this is that class hierarchies can become unmanageable.

    Read more
  • Understanding Sets With JavaScript

    Sets can be very powerful if you understand how to use them. A few applications of sets include solving counting problems where you may want to find the number of ways you can group elements together. Another application is problems that require you to find relationships between elements. The ECMAScript specification doesn’t include methods for operating on sets in this way. But it is possible to create your own.

    Read more
  • How to Level up Your Development Career

    I recently read the book Apprenticeship Patterns which advises programmers how to overcome the challenges of being self-taught and become better at what we do. Apprenticeship Patterns does not tell you how to write better code. Instead, it presents roadblocks you would encounter during your career with solutions to help you overcome them.

    Read more
  • Build a Website With Jekyll and GitHub Pages

    The options for building a website include website builders like SquareSpace and content management systems like Wordpress. Both provide templates to design your site and require you to pay for hosting. The other option is to build your own content management system. But that may not be worth the time and effort for a small project. However, if you just need a site to show off your portfolio of projects or start a blog I recommend using Jekyll to build the site and host it online for free using GitHub pages.

    Read more
  • Asynchronous Programming With JavaScript Part 2

    In part one of this tutorial, we learned the principles behind asynchronous programming and using callbacks. To review, asynchronous programming allows us to write code that is non-blocking by executing blocking tasks later. Callback functions provide a way to synchronize the execution of our code. However, nesting callbacks repeatedly is not a good pattern to follow. Here come promises to the rescue.

    Read more
  • Asynchronous Programming With JavaScript Part 1

    There is a lot of talk about asynchronous programming, but what exactly is the big deal? The big deal is that we want our code to be non-blocking. Tasks that can block our application include making HTTP requests, querying a database, or opening up a file. Some languages, like Java, deal with this by creating multiple threads. However, JavaScript has only one thread, so we need to design our programs so that no task is blocking the flow.

    Read more