Archive for the 'Software Design' Category

The Internet Explorer Z-Index Bug

Posted by riwalk on 27 Jul 2010 | Filed under: CSS, Software Design

Z-Indexes. They seem simple enough. At least they seem to simple enough that Microsoft could implement them without messing it up. Unfortunately, this is not the case.

The z-index bug in Internet Explorer is troublesome because it affects both IE6 and IE7. Unlike many of the Internet Explorer bugs, this one is likely to stick around for a while.

So how did Microsoft screw up this one? Imagine we have […]

Imitating Derivation Constraints in C++

Posted by riwalk on 21 Jul 2010 | Filed under: Software Design

One of the nicer features that is present in C# (and not in C++) is the ability to have constraints on template parameters.

Say, for example, you wanted to create a Set class that holds a set of unique objects. We could write a simple Set class that checks if an item exists prior to adding it. To extend it, we could make it a template class so that it would accept any object, and we would be done.

But what if we wanted to use a function such as IsEquivalent() on our template parameter? How can we be sure that our template parameter defines a given function?

In a language that implements derivation constraints, this is fairly straightforward. We simply write […]