Is there a business reason for striving for pure CSS layout?

Since this is stackoverflow, I’ll give you my programmer’s answer

semantics 101

First take a look at this code and think about what’s wrong here…

class car {
    int wheels = 4;
    string engine;
}

car mybike = new car();
mybike.wheels = 2;
mybike.engine = null;

The problem, of course, is that a bike is not a car. The car class is an inappropriate class for the bike instance. The code is error-free, but is semantically incorrect. It reflects poorly on the programmer.

semantics 102

Now apply this to document markup. If your document needs to present tabular data, then the appropriate tag would be <table>. If you place navigation into a table however, then you’re misusing the intended purpose of the <table> element. In the second case, you’re not presenting tabular data — you’re (mis)using the <table> element to achieve a presentational goal.

conclusion

Whom does this hurt? No one. Who benefits if you use semantic markup? You — and your professional reputation. Now go and do the right thing.

Leave a Comment

tech