Nick Ang profile picture

Nick Ang

Want to see a full list instead of pages of results? Click here.

Why implement Stack in JavaScript when you have Array?

This is the stupidly simple question I asked myself today as I was trying to familiarise myself with data structures. Is there ever a need to implement a stack data structure in JavaScript when the built-in Array data structure already exists? Based on my short research, the answer is no - there’s…


Bubble sort explained

The goal of bubble sort is to sort an array in ascending or descending order according to a sortable property. In our example below, we just use an array of integers to directly simulate the sortable property (a number), but in reality, you can imagine that that probably isn’t a frequent use case…


How to prevent jQuery from loading image in parseHTML

This post is inspired by a recent bug fix at work related to jQuery’s method. I noticed multiple redundant calls to our server endpoint each time a user saves an email template using the drag-and-drop email builder of Metisa. The bug, when traced to its end, was nothing like what I’d originally…


What is DRY (in programming)?

Photo by Ben Neale on Unsplash Ever heard someone tell you that your code is not “DRY”? What’s the deal with that? Are they saying that your code can hold a lot of water…? Sorry for the bad joke. DRY is an acronym, and it stands for Do not Repeat Yourself. As far as I can tell so far in my short…


Why use Binary Search Tree?

Photo by Nathan Fertig on Unsplash If you already know what a binary search tree is for and how it works, read on to learn about their main strengths and weaknesses in this post! Otherwise, feel free to take a moment to read part 1 for an introduction. Why is a binary search tree useful? What are…


Binary Search Tree explained

Not my arm. Photo by Patrick Fore on Unsplash What is a binary search tree? How is it related to binary search? Is it an algorithm or a data structure? In this post I’ll share what I’ve learned about binary search tree in the last week from videos, tutorials, and practice. As usual, the resources I…


Binary Search explained

Photo by Pablo Garcia Saldaña on Unsplash If you’re a software engineer, you’ve probably heard about binary search before. And if you don’t know what it is, how it’s implemented, and its strengths and weaknesses, this post is for you. Binary search is, as its name suggests, a search algorithm. In…


How to implement a Linked List in JavaScript

Photo by LinkedIn Sales Navigator on Unsplash In this post, you’ll learn how to implement a linked list in JavaScript. This is the second part of a 2-parter post on linked lists (read part 1). Let’s jump right in! Key components Here are the key components of a linked list data structure: A…


Linked List explained

Photo by Simon Abrams on Unsplash A linked list is one of many commonly used data structures. The first thing to know about linked lists is that they are not the same thing as array-like primitives (eg. in JavaScript or in Python). They are similar in some ways, but they have different strengths…


Algorithm time complexity and the Big O notation

Big O notation has attained superstar status among the other concepts of math because of programmers like to use it in discussions about algorithms (and for good reason). It’s a quick way to talk about algorithm time complexity. While it’s a math concept that applies to various fields, programmers…


Why online advice is dangerous

Medium is becoming a major source of online advice for me and I’m getting worried It’s 8:00am in the morning on a weekday and I’m sitting in my living room mindlessly having breakfast. My attention is being given to the Medium posts appearing on my feed this morning. In this particular week, I’m…


Writing my first Sass mixins

Photo by Dmitri Popov on Unsplash Sass is a CSS pre-processor. Even though I’ve been using Sass in many projects, I realised recently at work that I’d only been using it in a very primitive way. Sass mixins didn’t even exist in my mind. The main ways I’d been using Sass are: declaring variables in a…


Getting good and getting a dream job

Photo by Christopher Gower on Unsplash Now that we’re coming close to the end of 2017, I’ve been thinking about my career and careers in general. Having begun my career as a software engineer about a year ago, I thought it’d be timely and useful to do some reflection. Incidentally, I had a…


What is Git?

Photo by William Bout on Unsplash What’s this weird sounding thing called Git? Is it Git or just git? What does it do, who uses it, and is it actually useful? In this post, you’ll learn all you need to know about git (yes, it’s just git!). What is git? Git is basically version control software…


Nike shoes designer Tinker Hatfield on design

Tinker Hatfield and one of the sneakers he designed (I’d be surprised if that assumption is wrong) I recently re-started to organise what my good friend Kegan and I call “docu-nights” where we watch a documentary film together at my place. There’s never an awkward obligation to sit together and…


Saying the obvious

Photo by Hello I’m Nik on Unsplash It’s important to say the obvious. Because obvious is not always obvious to everyone. Because obvious is only obvious at a certain time, in our lives and in a day. Something always comes along and obscures it. Because the obvious will always slip into oblivion…


What are bugs in software?

Photo by Glen Carrie on Unsplash “Crap, I think there’s a bug. This isn’t supposed to work like that!” Have you heard a software engineer mention “bug” before? Well, it’s inevitable, because bugs are everywhere in software… But what exactly are we referring to when we say that “there’s a bug” in a…


Do I need to type fast to be a programmer?

Photo by Ilya Pavlov on Unsplash Let’s talk about a complete misconception today. I’ll put it out there… you don’t need to type fast to be a programmer. Why? Well, mainly because 99 percent of the time, your brain is playing catch up with your fingers. This disparity between brain processing speed…


How to start using the command line (part 2)

Photo by Dan Edwards on Unsplash Welcome to the second part of How to start using the command line. You can read part 1 here if you haven’t already - I cover the most basic commands there to get you started. In this second part, I’ll go through a few more basic commands and introduce the concept of…


Optimisation: Is it worth the time? (part 1)

Photo by Todd Quackenbush on Unsplash Let’s say you have a routine task (it doesn’t have to be a programming task, but that’s what your mind is almost always on, right?). We can call it Task A. If optimising Task A takes a full day to complete, and it can purportedly shave one minute off the normal…