Google Wave impressions

Tags:

So I got a Google Wave developer sandbox account. If you don’t know what Google Wave is, you’ve probably been living under a rock, and you should go check out the aforementioned link. It has a nifty video demonstrating various parts of it.

I’ve had time to play with it for a while now, and while it’s a pretty cool concept, is it actually useful for anything, or will it be?

Read More

What is a null object, and when are they useful?

Tags:

If you’ve written code, you’ve probably used the value null to indicate some variable is not set. This is perfectly good, but did you know there’s more to nulls than just the value null?

There is also a null object, which doesn’t really have anything to do with the value null, but its purprose is similar.

How many times have you written code, which checks if a value is null, and then displays something special because of that? Have you written the very same check in more than one place in your code? A null object is an elegant solution to this.

Let’s check out what exactly is a null object, and when it becomes a valuable pattern.

Read More

How to get free publicity by screwing up your friendly URL algorithm

Tags:

Today I’ll share a fun story with you. Would you like to get free publicity? Go ahead and make a poor friendly URL implementation, like the Finnish Broadcasting Corporation, or YLE – the national broadcasting company of Finland – did.

YLE had a very naive friendly URL algorithm on their web site. As you may guess, people found out about it, hilarity and poor publicity for YLE ensued, and finally YLE got to tell everyone how hackers abused their URL algorithms – except they forgot to tell everyone it was very much their own fault.

Read More

Improving code with peer reviews

Tags:

Peer reviewing is the practice of looking at code written by others to find errors or ways to improve the code. Sometimes also called desktop reviewing, this approach can be useful for various reasons:

  • If you have a coworker who is more experienced than you, you can learn from him/her
  • It’s often helpful to have another set of eyes take a look at code – different people see things differently
  • It helps the other programmers keep track of progress in parts of code they are not working on

We’ve been using this practice at work, and I think it has been useful for us in all the above reasons.

Brandon Savage has been writing a post series on peer review. In each post, he takes the original snippet of code a bit more towards better practices, introducing new approaches. Head over to Brandon’s blog to learn more!

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 the cohesion of your classes – it’ll make them more difficult to use and understand.

Let’s take a look at what makes or breaks an abstraction!

Read More

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. Continue reading to learn more!

Read More

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 in other languages, such as ActionScript.

Read More

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 – Let’s look at what they were and how they affect the code and tests.

Read More

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:

  1. The smart-and-gets-things-done programmer
  2. The smart programmer
  3. The “just a” programmer

So how do you determine if a programmer goes into one of these categories?

Read More