Notebook

Reduce and Conquer

Bulbophyllum falcatum
reducin' all the way

In an ecosystem riddled with large, portentous frameworks, [Redux][] is a refreshingly ascetic little store management system. Driven more by its functional programming-inspired tenets than supporting code, it offers — and needs — only a few helper functions to manage its stores.

Minimalism is good. It's also a good idea to abstract oft-used patterns into more expressive forms. Ideally, code should be crafted such that its intent comes out on first read, while making deeper digs possible when required.

Happily enough, the judicious use of delightfully succinct higher-order functions is often all that's required to tailor-suit some ergonomics into the manipulation of middleware and reducers. This blog entry will showcase some of those helper functions that work for me.

This article assumes you're already familiar with Redux. If this isn't the case, you might want to check out first one of my [previous articles][pollux], which provides a gentler, if a tad unconventional, introduction to the framework.

Read More >

JSON Schema, shortly

a stenograph - picture by Chatsam / CC-BY-SA-3.0
optimizing that whole typety-type business thing - picture by Chatsam / CC-BY-SA-3.0

JSON Schema is a neat way to describe or prescribe structural expectations of JSON documents (or, indeed, any data structure, let it be a JavaScript plain object or the equivalent in another language). But JSON schemas are themselves JSON documents and, while machines love a good ol’ JSON format, let’s face it: for us humans it’s a lengthy, picky, and mildly onerous format to write and read.

Fortunately, there are many ways to craft JSON schemas while circumventing most of its JSON-born tediousness. Let me show you a few of them.

Read More >

Stitching up a better monster

Custom, QR coded yarn labels
Custom, QR coded yarn labels

The nice thing with knowing a technology well, is that you can create a lot of nifty things. The nicer thing with knowing a healthy smattering of technologies, is that with the right amount of cunning and slyness you can gather things here and there and build something that is niftier than the sum of its parts.

Read More >

Actioner (Another Engine)

I'm still playing around with Redux and, as usual, I'm always on the lookout for ways to optimize my laziness.

One thing that I found irks me just a little bit are the Redux actions. They are nothing but raw Javascript objects, meaning they are very easy to set up and manipulate. But since anything goes, they are also very easy to subtly get wrong. For example, I'm working on a spaceship game and I have an action called MOVE_SHIP. But what arguments was I using for that? Was it this:

{ type: 'MOVE_SHIP', ship: 'enkidu' }

or rather, that:

{ type: 'MOVE_SHIP', ship_id: 'enkidu' }

Sometimes, I remember to double check myself, but other times, I'll use the wrong property and set myself up for a long, protracted, somewhat less-than-joyful debugging session.

Read More >

Redux redux (via Pollux)

Redux is a small JavaScript library that is quite popular at the moment. Liberally inspired by functional programming principles, it offers a state container that is accessed and modified via message passing.

Thanks to this message passing, and a strong emphasis on immutability and pure functions, it minimizes surprises and maximizes sanity. One of its beautiful promises, for example, is that since the state is only modified via messages (or actions) and pure functions, one can consistently replay the actions of an application and end up in exactly the same final state.

As I was reading and playing with Redux, I began to wonder... This is a blissfully small library. How easy would it be to port it to Perl? In the name of science, I had to try.

Read More >

Leap Motion

Leap Motion is a slick little infrared sensor unit you can buy for $80 online, or at your local Best Buy. A quick install later and you can now wave your hands in space above the unit and interact with your computer in three dimensions.

Leap Motion

I had the pleasure of working with Leap for a partner proof of concept and thought I'd give you some of my early thoughts and observations.

Read More >

Handlebars

Picking a templating engine

Choosing a templating engine can be a difficult aspect of building a website. Designers need enough control over the structure and layout of the site to be able to refactor it without requiring any programming, while developers need to be able to easily insert data programmatically into the site. Finding the right balance between those needs isn't a trivial task, since it depends a lot on the makeup of your team.

The templating engines that exist span a wide range of organizational styles, from entirely developer-focused to entirely designer-focused, with all kinds of options in between. One of the options that has provided us with the best compromise between ease of use for developers and designers so far has been Handlebars.

Read More >

We solve problems with technology. What can we solve for you?

Reach Out

t: 800.646.0188