What makes an abstraction good, and why should I care?

Tags:

You probably know what abstraction means – making a complex process simpler – but do you know what makes an abstraction good, and why it’s important? If you are writing code for a project that lives a bit longer, or has multiple developers working on it, having a good abstraction matters. Lack of a good and consistent abstraction will reduce …

Reader challenge: Keep track of code errors

Tags:

The book Code Complete suggests to keep track of common mistakes. This is so that you can see what mistakes you make most often, and so that you can have a checklist of things that you should check when debugging. I want to challenge you, dear reader, to keep track of your mistakes with me for the coming three weeks. …

Using canvas to do bitmap sprite animation in JavaScript

Tags:

Have you ever thought about writing a game? If you have, you’ve probably wondered how to render animations for your game characters. In this post, I’ll show you how you can use JavaScript to do time-based sprite animations, drawing them on canvas – vital if you want to do a game. You can also apply the same techniques I’ll show …

Unit-testing essentials

Tags:

Here’s some essential unit-testing posts I’ve written recently. While some of them have examples in PHP, they should still be useful in other languages as well. Unit testing PHP series Unit testing introduction Writing and running tests Writing tests for exsisting code Mock Objects and testing code which uses the database Test-driven development General testing topics Unit-testing JavaScript How to …

How to make your code testable

Tags:

Image by Jim Frazier I’ve recently been working on a code-base which wasn’t designed with test-driven development methodologies, or with unit testing in mind. As I implemented unit-tests to this code, there were some modifications I had to do on the code. Some modifications popped up more than others. There were a few things that are more common than others …

The three types of programmers

Tags:

The other day I was thinking of programmer types. In a way, I think there are three kinds of programmers when looking at a high level: The smart-and-gets-things-done programmer The smart programmer The “just a” programmer So how do you determine if a programmer goes into one of these categories?

Unit testing JavaScript

Tags:

I’ve recently been looking into some JavaScript unit testing frameworks. There are many alternatives, and while many of them seem good, very few of them actually matched my requirements: Must be able to run tests from the commend-line Tests should be relatively easy to write