A closure is a function bundled with its lexical environment

JavaScript is a lexically scoped language. This means that functions use the variable scope that was in effect when they were defined (not the variable scope in effect when they are invoked).

Technically, all JavaScript functions are closures, but because most functions are invoked from the same scope they were defined, it doesn’t matter that there was a closure involved.

Closures are commonly used for encapsulation (the ability to have private properties for objects), functional programming (curried functions, partial applications) and to grant access to variables inside event listeners.

Let’s take a look at each of these use cases to help us understand what closure is. …

All of software development is composition. The breaking down of huge problems into smaller pieces and stitching them together so that, not only are the smaller problems solved independently of each other but they work together to solve the bigger problem. JavaScript Applications mix functional programming and object-oriented programming extensively. We make objects for our functions and functions can make more objects.

The breaking down of problems into smaller problems and stitching them together (from a functional perspective) is the topic of this post. How you do it matters for your growing codebase.

Composing Functions

What does it mean to ‘compose’ functions? Take a look at the below…

I’ve recently been trying to get my head around how to make objects in JavaScript (specifically, many of them), as well as understanding .prototype, __proto__, prototypal inheritance vs class inheritance, and object composition. It's quite a deep subject and this blog post probably scratches the surface but I hope it helps you understand it a little better too.

I’ll start by looking at how we make one object and how this evolves to a factory function, constructor function, and classes. Then we’ll look at why you might want to favor certain methods.

These thoughts aren’t my own, rather an amalgamation of what I’ve learned elsewhere. What you are about to read, I sourced from the following references. If you don’t quite get everything you need from this post I’d encourage you to dig into…

Recently I’ve been trying to become a better software engineer and programmer and something I’m trying to get my head around is how to ‘encapsulate’ your code well. Encapsulation produces code that has loose coupling but high cohesion. Capsules of your code work seamlessly together but also independently of each other.

As put by Eric Elliott here, the encapsulation of code is the bundling of data and the methods that act on that data such that access to that data is restricted from outside the bundle. It’s the local retention, hiding, and protection of state processes.

Code that is well encapsulated keeps in mind three timeless principles in software…

Image for post
Image for post

…But there are also unknown unknowns. There are things we don’t know we don’t know.

-Donald Rumsfeld

This is how I felt when I became a Web Developer almost a year ago. I knew very little about not a lot and had no idea what I didn’t know. Now, a year in, I know what I don’t know and have a plan in my head of how I want to end up knowing it.

What I want to share here is my personal learning methodology/roadmap. …

6 things I learned in my first 3 months

Image for post
Image for post

When I started as a frontend developer at 93digital in London, I had a basic knowledge of HTML and CSS and no JavaScript experience.

This was just enough to get me through the door, but once I was part of the team I learned that there is so much more to being a frontend developer than I previously thought. Here are my top 6 takeaways from my first 3 months in the industry and some great resources to help you out if you are interested.

1. You Are Probably More Valuable Than You Think You Are

Honestly, you are.

You’ve probably heard of the phrase ‘Imposter Syndrome’. There many different spins on its exact cause/definition but for me it is a feeling you get when you are dealing with things you are not ‘qualified’ for. …

No time? Scroll to the bottom to see my top 5 tips for writing good code in Webflow.

TLDR: If you are a front-end developer, test out using Webflow to “write” your HTML & CSS. It is a user interface for code that, if used correctly, can quickly generate good quality mark-ups. Just be sure always to use a style guide and watch out for class names, non-semantic HTML and excess code.

Image for post
Image for post

I recently used Webflow to generate most of the HTML and CSS for a homepage. I found that, once I had the process down, I could produce a lot more quality code in a given amount of time than I would normally be able to. …

An unconventional approach to becoming a professional web developer

I’m just starting in my journey as a part-time freelance web developer. I make money from developing websites for people, and I am also a student at Flatiron School learning how to code. At the moment, one does not help me with the other, but I’m working towards the two being synonymous one day. Confused? Don’t worry. In this short post, I will explain what the below picture means, why I am approaching my web development career in this way and how it might benefit you too.

Image for post
Image for post
a detailed illustration of my brain going into 2019

At one end of the spectrum I am learning the fundamentals of full-stack development (the coding side), and at the other, I’m freelancing. Somewhere in the middle, I want to become a professional that’s able to draw on expertise in both to create amazing experiences for my clients. …

“Before you jump you need to make sure you can afford to drown”

About six months ago I decided I was going to do a web development boot camp. Why? Well, I’m going to try and explain but if you haven’t got time to read all of this then here’s a summary:

I would be lying if I said I knew precisely why I enrolled with Flatiron School to learn how to code. My end goal with it all changes on a weekly basis. …


Aaron Thompson

The incomplete notes of a self-taught developer.

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