Defining Functions in JavaScript

Here I take a look at the not-so-subtle difference between how functions can be defined in JavaScript. Declarations & Expressions There are two primary ways of defining functions in JavaScript: function declarations and function expressions. A function expression looks like this: const sum = function(a, b) { return a + b; }; It…

Channels for JavaScript

Introduction If you're already familiar with channels in Go and want to try them in JavaScript then check out my port, otherwise continue reading for background explanation. Channels make it easier to write programs that interact with other programs or processes. Concurrent code written with channels is more elegant, concise,…

Combining Objects in JavaScript

The subject of inheritance in JavaScript has been needlessly complicated given that the underlying mechanism is elegant and simple. This article is appropriate for beginners as well as experienced JavaScript coders who would like a fresh look at how to combine objects. It assumes familiarity with basic JavaScript syntax. Here…

When To Be Tenacious (and When Not To Be)

Software developers love to solve problems. The rush of solving problems is what gets us out of bed and onto our keyboards in the morning. It feels great and is inherently motivating. If you're managing a true software developer, you never have to worry about motivating her to work. In…

How Much to Test?

A recent question from a coworker elicited ideas I'd like to share about one of my favorite topics: Test Driven Development. Coworker's question: The thing that blocks me the most is striking the right balance between writing too many tests such that the software isn’t as flexible and not…

Why We Code at Midnight

If you're a developer, the kind who doesn't work on a punch clock, chances are you've written code at midnight or even later. Have you ever thought about why that is? Let's do a thought experiment together. Let's pretend that you're the founder of a new, perfect company. It's not…