F...ancy PHP: immutable data

27 April 2018

This series is a challenge: what features of the more well-regarded languages does PHP already have? What others can it emulate?

In this article I will tackle immutable data. Spoiler: this is not how PHP chooses to approach data. However, emulating this functionality results in code that is easier to understand and debug. Furthermore, examining in depth how PHP treats data "under the hood" helps improve code performance. Let's dive in!

Continue reading →

F...ancy PHP: higher-order functions

15 April 2018

This series is a challenge: what features of the more well-regarded languages does PHP already have? What others can it emulate?

Since I've been thinking of functional programming a lot recently, let's tackle higher-order functions first.

Continue reading →

Breaking out of Klipse

30 November 2017

Every so often, the Clojurians community in London runs a workshop for people under-represented in the software industry, called ClojureBridge (the workshop materials are available online.) It's advertised as targeted for both beginners and experienced programmers, so being the curious sort, I naturally signed up.

During the workshop you play with Clojure in Klipse. One of the early things they teach you is arithmetic: how to sum up a sequence of numbers. Said numbers are listed on the workshop webpage. The student needs to type them into Klipse manually. At that, my brain strongly protested. The numbers, it said, are right there. Why do I need to re-type them? Why not just strip them out of HTML?

Continue reading →

Solving problems with meditation

06 September 2017

I'm sure you've heard of meditation, perhaps even mindfulness. Along with physical exercise, it is often floated as the solution to all life's problems.

Is it?

Continue reading →

Composing a function of binary arity

10 July 2017

Way back when, also known as 28th June 2017, I went to a London Clojurians coding dojo meetup. Wherein one of the ideas floated for small dojo projects was to code some cyphers, inspired by Wonderland Clojure katas.

Very well. My group started with a simple ROT. At which point I got an urge to split the character traversal algorithm from the actual operation performed on characters, hereafter referred to as f, because we're in Clojure-land and the Clojure way is to be wonderfully terse when naming function arguments. (Whereas I can be wonderfully terse about the benefits of having readable code. But since I don't have a drink at hand, let's leave the rant for some other day and continue.)

Continue reading →