Archive for August, 2006

Using Fewer Images

August 27th, 2006

Image rollovers are usually composed of two individual images; one for the default state and one for when the mouse is hovered over the image or link. However, it bears some advantages to use a single image by taking advantage of CSS background image offsets. Read the rest of this entry »


Opt for Pre-incrementing Iterators

August 26th, 2006

There’s a slight performance advantage in using pre-increment operators versus post-increment operators. In setting up loops that use iterators, you should opt for using pre-increments:

for (list<string>::const_iterator it = tokens.begin();
    it != tokens.end();
    ++it) { // Don't use it++
    ...
}

The reason comes to light when you think about how both operators would typically be implemented. Read the rest of this entry »