I’m Writing a Book

May 19, 2013

I was relaxing on Saturday afternoon while thinking about a new blog post about simplifying CSS. The whole point of the blog post was to address some dodgy CSS I found a co-worker writing. It was a mess of ultra specific selectors using IDs and qualified selectors–it made me want to throw up.

So as I started writing an outline I remembered that I had read several articles related to, not necessarily badly written code, but overly complicated code. See Harry Robert’s Code Smells in CSS. This seems to be a common theme and, personally, I had to learn how to break certain habits through trial and error over a long period of time.

When I saw the following code in my co-workers’ stylesheet I knew that it needed addressed:


html.no-js body div.footer-bar div.waves div.wrap aside.testimonials form#contact_form.validate div.clear input#mc-embedded-subscribe.button:hover {
    ...code goes here...
}

I know, I know, this code is so specific even Houdini couldn’t break out of it. To be fair he resorted to this because he couldn’t get the styles to take, but that’s no excuse. When I asked why he chose to write it like that and how he can avoid it by keeping it simple he explained that that’s how he was taught to do it in school.

This is probably a common occurence in the institutionalized teaching of web design, it always seems to be years behind and it is failing these students by not providing them with an up-to-date, useful education. So this is why I’ve decided to write a book about simplifying CSS.

Leave a comment