David Weldon

true : false

I try not to be too pedantic about grammar, but I have a few pet peeves. It bothers me when people use less instead of fewer, and don't get me started on the overuse of literally.

In JavaScript, it feels like nails on a chalkboard whenever I see a conditional which redundantly evaluates to true or false. Take this example:

var isEmpty =  . . .

Read More

March 06, 2016

coffeescript => es6

I've been using CoffeeScript for most of my development work since 2011. In general I appreciate the language's brevity and features (most of which keep you from shooting yourself in the foot).

With the rising popularity of ES6, I decided to read Axel Rauschmayer's excellent book and take it for a spin with some of our new . . .

Read More

March 02, 2016

meteor: how we use a CDN

We recently added a CDN in front of all of our apps after reading this post by Josh Owens. For our demo app, we saw an 84% reduction in overall load time, so I'd strongly recommend doing this for any production code. Listed below are the steps we used.

First, we created a CloudFront distribution for each app. The non-default settings we . . .

Read More

January 24, 2016

meteor: how we define methods

I've been inspired by the meteor guide project to start talking more about the coding practices at Edthena. Keep in mind that the focus of these "how we" articles will be the techniques we have discovered while maintaining a large meteor codebase over several years. In other words, some of these concepts may be overkill for . . .

Read More

October 28, 2015

meteor: template instance

In scoped reactivity we learned how templates can maintain their own reactive state. A common frustration with this technique is that Template.instance() is pretty verbose. This is particularly noticeable when writing helpers like these:

Template.colorSquare.helpers({ currentColor: function() { return Template.instance().currentColor.get();  . . .

Read More

October 02, 2015

meteor: collections by reference

You may find yourself in a situation where you need to modify a collection by name, or write a function which performs a generic operation on any collection. In these cases, you'll need to understand how to dynamically access a meteor collection instance by reference. In this post we'll explore these concepts with a couple of simple . . .

Read More

September 19, 2015

coffeescript tricks

a selection of artisanal amuse bouche

Like all programming languages, coffeescript has a number of subtle treasures. In this post I'll catalog several of my favorites. Enjoy!

Destructuring assignment

Destructuring assignment is a really cool feature which lets you initialize one or more variables by pattern matching them to an existing object or array. I use this everywhere . . .

Read More

September 16, 2015