Posts filed under “programming”

Install mcrypt PHP extension on OS X Snow Leopard

Please note: The following instructions apply to Mac OS X 10.6 (Snow Leopard). I have an updated guide for how to install mcrypt on 10.7 (Lion). mcrypt is a useful extension to PHP if you would like to support a wide range of encryption algorithms within your code. This guide explains how you can enable [...]

Objects in Perl (part 2,352)

One of my issues with Perl has always been its implementation of OOP. Or, to be precise, the multitude of ways that a class can be declared (blessed hash, inside-out, Class::Std etc). I would argue that this is a case where TMTOWTDI is not advantageous. Enter Piers Cawley and his _Moose for Ruby Programmers_ talk at [...]

The problem with complex error messages

Whilst I found myself agreeing with most of Jeff Atwood’s post The Problem With Logging, I strongly disagree with his third point: If it’s worth saving to a logfile, it’s worth showing in the user interface. This is the paradox: if the information you’re logging is at all valuable, it deserves to be surfaced in [...]

Review: London Perl Workshop

Spent an interesting morning in the company of many Perl mongers at the London Perl Workshop. Although I don’t use Perl as my primary language any more, it was was interesting to learn about the current movements of its London-based community. The talks I attended were: The Complete History of the Perle Mongers of Olde [...]

Real World Lisp

Prompted by a question posed by one of my colleagues today, “has anyone ever used Lisp?”, I surprisingly found myself being the only person that had. I played around with it many years ago after being inspired by Eric S. Raymond’s seminal article, “How to Become A Hacker” in which he explained that “getting” Lisp [...]

London Perl Workshop – 29th November

The London Perl Workshop is a free one-day conference in central London, UK. It will be held on Saturday the 29th of November, 2008 at Westminster University’s New Cavendish Campus I’ll be attending, and so will my friend and fellow Yahoo Mike Whitaker, who will be presenting some talks on Moose and Enlightened Perl. London [...]

Wise Words from Martin Fowler

I’ve become quite obsessive about unit testing recently, and in particular the PHPUnit testing framework. A big proponent of test-driven development is Martin Fowler, and I keep one of his quotes in a sticky note on my desktop as a little reminder: Whenever you are tempted to type something into a print statement or a [...]

New BBEdit Search and Replace Window

One of the new features of BBEdit 9 is the new Find/Replace Window, shown below: It’s been simplified a lot since the last version, but the really big change is that it is now a modeless window. This means that the Find/Replace window can be left open whilst still allowing interaction with document windows. Initially, [...]

Singletons and global state

A very useful article from Google’s MiÅ¡ko Hevery about the problems with the Singleton design pattern. Essentially, Singleton’s rely on a global instance variable which could point to any number of other variables, thus creating a global state. This causes problems when you want to test your code. Root Cause of Singletons Top 10 things [...]