Test Driven Development training course notes

A couple of weeks ago Chris and I went on a TDD course from Codemanship.

»
Author's profile picture Dave Hulbert on tdd and design

Balancing Technical Debt and Clean Code talk at the BCS

Last week I gave a talk at BCS Dorset about technical debt:

»
Author's profile picture Dave Hulbert on talk and technical-debt

HTTP messaging PSR-7 update

This is a quick update to my original blog post criticizing mutability in PSR-7.

»
Author's profile picture Dave Hulbert on design, php, and frameworks

Traits with interfaces

In PHP, Traits can't implement interfaces. They can, however, include abstract methods. These methods then need to be implemented by the concrete class that implements the trait. This allows a trait to provide some boilerplate implementation that depends on an concrete implementation. This isn't always a good idea (it's verging on violating the Dependency Inversion Principle but it's better than a trait attempting to use a method that has no contract.

»
Author's profile picture Dave Hulbert on design and php

Thoughts on PSR-7

PSR-7 contains interfaces for HTTP messages. These are like Symfony Kernel's Request and Response interfaces. Having these new interfaces would be great for the PHP community but there's a couple of issues with their current state that I'm not happy with.

»
Author's profile picture Dave Hulbert on design and php

Singletons: bad. Shared resources in a DIC: good.

Singletons

»
Author's profile picture Dave Hulbert on design, php, and solid

Should I use global variables?

Someone posted a question about using global variables on r/php, which I answered. Copied here for posterity.

»
Author's profile picture Dave Hulbert on design, php, and solid

Notes on designing through mocking

My notes on Everzet's talk "Design how your objects talk through mocking" at PHPNW14

»
Author's profile picture Dave Hulbert on design and php

Strace

Quick strace command that I use all the time to see what files a process is opening:

»
Author's profile picture Dave Hulbert on linux

Conway’s Game of Life in Canvas

I haven’t done much with Canvas, so I thought I’d experiment by making Conway’s Game of Life with a little JavaScript. Conway’s Game of Life is based on a grid of cells, which are either alive or dead. It has 4 simple rules rules:

»
Author's profile picture Dave Hulbert on javascript

Bitcoin: the cryptographic currency

Bitcoin is a digital currency without any central control. It was introduced 4 years ago today (3rd January 2009). 1 Bitcoin (BTC) is currently worth around $13. Last year Bitcoin grew considerably in market cap (now about $150 million) and popularity, with many organisations accepting Bitcoin as a form of payment.

»
Author's profile picture Dave Hulbert on economics and cryptography

Generators in PHP 5.5 (with PDO)

As the first alpha of PHP 5.5 has been released, now is a great time to play with its new features. The first new feature is generators. Generators are like very simple iterators.

»
Author's profile picture Dave Hulbert on php

Batch converting images with ImageMagick

Every now and then I need to batch resize or change the quality in some images. Photoshop and the GIMP let you do this, which is fine if you’re happy using your mouse or lots of RAM. The most efficient way of processing images is with ImageMagick. ImageMagick is the canonical way to do image manipulation and many GUI tools are based on it. ImageMagick is a useful tool to know and learning the basics of it will hopefully save you lots of time.

»
Author's profile picture Dave Hulbert on bash, shell, and linux

Immediately-Invoked Function Expressions in PHP

In JavaScript

»
Author's profile picture Dave Hulbert on php and javascript

PHP coding standards and style guides

The PHP Framework Interoperability Group (PHP-FIG) are a group representing most of the big names in the PHP world such as Zend and Symfony. The group has formed to encourage PHP frameworks to be more interoperable. They’ve come up with 3 standards: PSR-0, PSR-1 and PSR-2.

»
Author's profile picture Dave Hulbert on php