Jon's Programming Blog

JavaScript-Style Promises in F#

Working in enterprise level back end software often times I need to get information from many different sources. When you have enough of these sources the time it takes to get all the information can really add up. That’s when F# async work flow really comes in handy. Except, there is a gotcha. Let’s say we have two sources we need to fetch data from: let myData () = async { let!

Using NPM as a Build Tool

I really like simplicity. The tools I use, I like them to make my life easy, not hard. They need to work out of the box. No huge configuration settings, just make it easy so I can get to work. Well, along come grunt, gulp, and now even more tools since I first started writing this that I won’t mention. Two build tools for JavaScript. Wonderful, we need tools to help us build our files.

On-the-Fly Lambda Expressions in JavaScript

Before many of the JavaScript compilers became real popular and if you wanted to write in straight JavaScript you could create functions on the fly. This was really nice for doing lambda functions. Here’s a couple libraries that did this. Here’s how it basically worked: var f = function(func){ var funcArray = func.split('->') return (funcArray.length === 1) ? new Function('x', 'return (' + funcArray[0].trim() + ')') : new Function(funcArray[0].

Building a Convention Based Routes in Node.js

Convention over configuration (also known as coding by convention) is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, and not necessarily losing flexibility. It seems in programming, if we haven’t learned the basic practices of others, we’ll end of repeating those practices; discovering them on our own. This isn’t necessarily a bad thing. It can be a good way to learn.

CSS Media Object

I just finished attending the RockIt Bootcamp (12 week program). It’s a program that teaches the LAMP full stack development (Linux, Apache, mySQL, PHP). In the next little while I will be going over some of the things which I learned. The css media object was first coined by Nicole Sullivan in 2010. It is still one of the most basic constructs to learn and understand in created good CSS content.

Angular.js vs React.js vs Mithril.js

Apparently Facebook has a bunch of functional-style programmers, not writing in ClosureScript though! [Starts at 40 minute 30 seconds. Person asks question then Jing Chen laughs at question, she must know how much Pete doesn’t like Angular.] So, the question was comparing and contrasting…React plus Flux and Angular. …[T]hey do solve some of the same problems but they go at it in very different ways. So React is focused a lot on treating your code as a black box.

bilby.js & lenses

In JavaScript nearly everything is mutable. This can cause problems in your code when you think you have a new object or variable but instead you are operating on the referenced object. So, we create patterns to alleviate this problem. Or we use libraries like underscore.js or lodash.js which incorporate the functional concepts. Unfortunately they don’t always use immutable objects either. Bilby.js solves the mutability problem by using lenses. Using the lenses pattern one can access and change one’s objects in a safe and immutable manner.

Match Expression for JavaScript?

Sometimes (or rather most of the time) it would be nice to have more concise code in JavaScript. I was working with a function that needed quite a bit of if statements. if was awfully cluttered. I had looked at bilby.js examples and hadn’t realized that you can do multiple ternary expressions in a row. So, instead of, if (0){ return 0 } else if (1){ if (2) { return 1 } else if (3) { return 2 } else { return 3 } } else { return 4 } You can do,

A Distributed & Robust Feedly

In light of the recent attack on I thought it might be interesting to see other ways we could propogate data accross the Interent without being succeptible to attacks, or, at least less accessible. With the approach outlined below we need to use an actual app instead of being able to use a browser (there might be a way to use a browser also, not sure how it would work though).


I’ve jumped ship from Excel programming over to JavaScript (in a functional manner). I’ve also gone the way of Linux away from Windows. I love Excel and its power. But I see the writing on the wall and am moving to where I can hopefully get some work and starting making some moolah. You can follow my new blog over at If anyone is interested in the products I’ve made let me know how you like them and send me an e-mail.