25. December 2013

Promises, promises, promises

Javascript is a fantastic little language, filled to the brim with warts and gems alike. One of the definitive gems is its asynchronous nature, but the flip-side wart is the reliance of callbacks to deal with it.

To combat the complexity that arises when you nest callbacks within callbacks, a number of patterns and solutions have emerged, one being promises.

Promises is a way of structuring up asynchronous Javascript code in a manner that makes it easy to follow and control the flow of execution.

more

08. December 2013

Hello, λ!

As you may already know, functional programming has its roots in a formal system called the Lambda calculus (or λ-calculus), which is a model of computation based on the ideas of function abstraction and application through substitution of bound variables. (Don’t worry, you’ll get the idea soon enough.)

The system was created by the American mathematician and logician Alonzo Church as a framework for answering the Entscheidungsproblem (lit. “Decision problem”) posed by the German mathematician David Hilbert in 1928. This problem can essentially be formulated as the question wether or not there exist a machine that, given a program, can compute if any given input is valid or not, according to the program.

more

08. December 2013

On Functional Programming

Functional programming is the best thing since prestressed concrete. I bet you have heard much about closures, purity, referential transparency, monads, type systems, lambdas, and about a million other things that fly about when this is brought up.

But what does this all mean, really? What is it good for? Why bother? These are but few questions among many that I hope we will be able to answer in our little series on the subject.

more