You can skip this, I just have to write it.

I think ethics is stupid. The different ethical frameworks that I’ve learned about: Act Utilitarianism, Rule Utilitarianism, Kantian ethics, and Social Contract theory. These were the subjects of the ethics class at my university — which I’ve failed two and…


I bought a Raspberry Pi 3 B+ a few years ago about the time I started learning Rust which was also about when I took OS dev. I wanted to learn OS development and I’d heard about CS140e so I thought it would be relatively easy. And it has been…


shitty drawing of a sad rocket turned into a happy washing machine
shitty drawing of a sad rocket turned into a happy washing machine

There are plenty of ways to build reactive interfaces, but my favorite is to use finite state machines. I’ve written before on how JavaScript Promises are finite state machines, but I only briefly touched on how finite state machines communicate between each other. …


An unskilled drawing of a short, dark wizard shooting a flaming “J” from one hand and a watery “S” from the other.
An unskilled drawing of a short, dark wizard shooting a flaming “J” from one hand and a watery “S” from the other.

There was an old trick used by Angular and a few other libraries of using a function’s source code (which you can get using .toString()) to get its argument names. Promisify-node used this technique to find arguments called callback or cb.


Sample of what we’ll be building

I’ll be using JavaScript here. With it we can write this in <100 lines of code.

Harness

We’ll start by laying out our code. I’ll be using closures, but you could — and my first version did — use a class instead. …


I’m excited about template elements. There’s no specified way of instantiating them, so let’s talk about where they come from, why we use them, and how to instantiate them.

Mommy, where do template elements come from?

Most likely, you won’t write them by hand. Instead, they’ll be generated from template literals, JSX, or something else. These generators…


Picture of various fruits in bins at a market: apples, oranges, pomegranates, etc.
Photo by Jakub Kapusnak on Unsplash

The Problem:

Polymorphism is important in any language and while it is very easy to write polymorphic code in JavaScript, it is relatively hard to manage that code. Without explicit types you must either assume the structure of an object, or explicitly test its structure before using any functionality. Explicitly testing slows…


I’ve been working in Rust on Web Assembly projects a lot lately. First was working through the Raytracing in a Weekend series except I’m using Rust and drawing to an HTML Canvas. Right now I’m working on a template for peer to peer websites that wouldn’t require hosting a WebRTC…


I’m a big believer in distributed systems. It is easy to see the need for distributed systems when we see the existing digital infrastructure being tested by COVID-19 levels of load. Unfortunately, distributing a system is not usually a simple task. Consistency no longer comes naturally and horizontal scaling is…


Writing correct software is hard. Whether you’re using functional programming or finite state machines, understanding the problem you’re solving and understanding your code are both required for correctness. Async functions and generators are stateful syntax for which we can draw state diagrams so that we can understand them. If you…

Evan Brass

I write a lot of ECMAScript… enough to have plenty of mistakes to learn from.

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