Never miss a beat

Join my newsletter.

The Archives

A brief summary on Automated Testing

Published: 8/20/2016

I recently read this amazing article by Josh Mock and felt the need to share it. In fact, the tools he uses in his examples – JavaScript, Mocha+Chai, and Phantom are the tools I use daily to do the same thing. I can’t stress enough how great his article is, especially if you’ve written some tests before but you’re not sure how to write a good test. That being said, there’s a few more things I’d like to cover and add to it. In summary, Josh covers the following things: Keep Business and…

Mighty Morphing Multimethods

Published: 8/2/2016

Type systems are a tricky thing. A lot of languages have very flexible type systems, such as F# with its inferred (and extremely well inferred at that) type system, or JavaScript with it’s untyped nature. Clojure hits a happy middle ground (for me, at least) – It’s dynamically typed (or “gradually typed”, if that’s your cup of tea). Why is the typing important? Polymorphism. Most of you probably learned polymorphism from your introduction to object-oriented programming course/book which was…

JavaScript: Generators

Published: 7/19/2016

One thing I’ve learned recently from Clojure (don’t worry, this post is about JavaScript) is that laziness is great. Lazy code is powerful code, allowing you to model things like infinite sequences or complex computations over a range of data. Without this laziness, an infinite sequence would cause a stack overflow or complex computations would bog down your performance when you may not even need to perform all those computations to begin with! Enter Generators With the latest rendition of…

Understanding Clojure's Map & PMap

Published: 7/18/2016

Let’s be honest – Part of the reason you’re using Clojure is the higher order functions like map . They’re great, composable, and describe what you’re trying to do instead of defining what to do – this keeps code simple. Maybe you’ve been playing with map for a while now and have even tried using pmap . If you did, you probably noticed that pmap is often slower than map , and if you want to know why – read on. What is map ? Before we get into pmap lets go ahead and clarify our…

Why I Switched from Python to Clojure

Published: 7/18/2016

First – a bit of background. When I first started learning programming, I started with a course in high school that focused on Java. From there, I decided I wanted to work for a start-up and I had to learn python (I was naive). I started playing with Python and it just felt right – at first. I spent some more time with it and started to realize that I needed something more. Here’s a brief list of the reasons why I switched. Interpreted Language Python is a dynamic language . There’s a massive…

Introduction to Asynchronous Programming in Clojure

Published: 7/15/2016

I’ve been writing about my favorite language, Clojure, for a while now. I’ve also been gauging your interest in Clojure and, if you’re reading this, I think you’re ready to take this relationship to the next level. Let’s talk about asynchronous code in Clojure. Getting Started If you want to follow along with the code examples, start a new project. I’m going to be using Leinengen and we’re going to name this app “warehouse”. Let’s open warehouse/src/warehouse/core.clj and modify it so it looks…