September 16, 2017

Javascript FP design pattern: Binding functions

Ok, ok, monads have been done. They’ve even been done by me before. But, functional programming is still popular, monads are still very useful for programming in an FP style, and people are entering the field every day. So here’s another attempt at an approachable introduction to usefully apply this pattern to everyday coding problems.

Read more »

September 3, 2017

Bucklescript vs Elm vs Typescript: Typed Javascript showdown!

You, a web developer, have probably heard of Typescript, may have heard of Elm, and you might even have heard of Bucklescript/ReasonML as well. Each of these represents a compiles-to-javascript language with strong type support, but each has some different opinions, philosophies, and features.

In this article I’ll walk you through the features of each of these options and compare their build ecosystems, editor tooling, and javascript interop. In addition, as is my habit, I’ve written up a small example in each of these languages. (Well, actually, I’ve taken one of Elm’s small demos and re-created it in the other two). I’ll discuss my impressions of the tooling and the coding experience along the way.

Read more »

August 28, 2017

OCaml for the impatient

Ocaml is a rad language with some regrettably underdocumented parts. Or, perhaps, overdocumented – since OCaml attracts people who are interested in rigorous correctness, what documentation exists tends to be rigorous and correct, and also tedious. This guide will be none of those. Let’s go!

Read more »

August 13, 2017

Best Practices for Javascript Library Versioning

I spend most of my time on this blog talking about Clojure, but IRL I work on a lot of projects written in a lot of languages. Lately, much of my time has been spent writing and maintaining React-based frontends in Javascript.

As far as I can tell, no language has solved the problem of dependency management. Some libraries are better than others, but upgrading dependencies is always an uncomfortable experience. That being said, I’ve never experienced more pain doing so than in Javascript’s ecosystem.

Read more »

August 6, 2017

Domain modelling with clojure.spec

Clojure.spec is, among other things, Clojure’s official answer to tools like Typed Clojure and Plumatic’s Schema. It represents an attempt to apply some validation to data and functions, without compromising Clojure’s dynamism and data-is-data philosophy. In this post, I’ll be working through a sample program by first outlining and modelling it with the help of clojure.spec, then using spec to guide me while I develop the implementation.

Read more »

November 4, 2016

On Advice (featuring just one piece of it)

I’m perfectly comfortable making wild assertions about which programming technique is better than which other one, but when it comes to handing out general life or career advice, I’m a lot stingier than your average blogger 1. Even if I was wildly...

Read more »

August 23, 2016

Basic site monitoring with Riemann

Riemann is a general-purpose event processing system, but its most typical application is as a place to send and generate metrics about applications. I recently set up a Riemann server for my personal projects, and I feel like my devops game is stepped up by 1000%.

Or, at very least, I feel like I know know about it as soon as one of my sites goes down.

Read more »

April 15, 2016

What’s in a namespace?

Every well-behaved clojure source file starts with a namespace declaration. The ns macro, as we all know, is responsible for declaring the namespace to which the definitions in the rest of the file belong, and generally also includes some requirements and imports and whatnot. But today (at Clojure/West, shoutout!) Stuart Sierra made a passing reference to the internals of ns during his talk that got me interested.

But what is a namespace really?

Read more »

March 27, 2016

Composible Architecture: A real-world example.

I am the primary maintainer of a significant REST API written using Flask-Restful. Flask-Restful is a pretty full-featured library for creating REST frameworks with Flask. It features everything you need to manage routing to class-based resources, a library for marshalling objects to JSON format, and reqparse, an argparse-inspired library for writing input parsers.

Read more »

March 26, 2016

React.js in the small

I’m a big fan of accessible technologies. I get suspicious whenever I encounter a framework or library that is “not worth it for a small project,” because that is a coded statement that means either “It has a broad scope of features that a small project won’t take advantage of,” or “it trades off simplicity or user experience for performance or other reasons.” Accessibility also helps open-source projects move from obscure to ubiquitous; if jQuery had required a command-line tool to compile it when it came out, I can practically guarantee you wouldn’t have ever heard about it.

Read more »

March 19, 2016

The Web is (finally) a mature platform

I started my career as a “web developer” circa 2007. I’d dabbled before with Javascript while making sites in HTML/CSS as early as middle school, but that was my first real job as a real software developer. Back in those days, LAMP (Linux/Apache/MySQL/PHP) was about the only sensible way to build a web application. You could use Java servlets, of course, or build applications using CGI, but once PHP was stable and available and straightforward, and it quickly became the obvious choice for a huge range of applications.

Read more »

February 28, 2016

Clojure SQL Migration Libaries

It is generally recommended, if you’re developing an application that uses a database, that you manage changes to the schema of said database using some sort of migration system or another. Luckily, several intrepid developers in the clojure community have stepped up with their own solutions to this problem – all of which end up being very similar indeed. Read on for an overview of your options and to find out which one is right for you.

Read more »

February 20, 2016

Plotting Reddit post frequencies with d3

This week I added a better graph to Later (for Reddit)‘s post timing analysis page. Previously, the most common time and the most common day were plotted on separate bar charts. However, I noticed that I got called out on this in this article on Medium, which offered a pretty sensible alternative that I wasted no time in ripping off wholesale. I still have the bar graphs in, but I also added a 7x24 color-coded grid plot, allowing for a more accurate view of exactly when the most popular posts were posted.

Read more »

January 11, 2016

Clojurescript Boot Live-Reload Weasel Vim-Fireplace Piggieback

My long-standing complaint about Clojurescript is that it’s a pain to get running. People who prefer Leiningen seem to have gotten a handle on this with figwheel; however, those of us who have jumped on the Boot train (it’s newer and therefore better!) still have to do some assembly to get the live-reloading auto-compiling repl setup that’s become the standard for Clojurescript development.

Like many problems in the Clojure universe, this is less a problem of technology and more a problem of approachable documentation. With just a little bit of configuration and some understanding, you too can assemble that perfect Clojurescript dev setup using Boot.

Read more »

January 4, 2016

Deploying a Clojure web app with Pallet

Pallet is a Clojure DevOps platform/library designed to automate blah blah blah. We all know what these things are supposed to do, the question is how they do it, and Pallet takes the agreeable tack of just being a Clojure library that you can run in a repl and do devops stuff.

Read more »

December 28, 2015

Clojure SQL library showdown

When it comes to database access, I’ve become less particular over the years as I’ve gotten more and more comfortable with SQL. These days I’m happier to write the SQL to get just the thing I want, than wrestle with an ORM to produce the same thing...

Read more »