Why CSS developers hate JavaScript?

Why CSS developers hate JavaScript?

A simple question that popped into my head after a long permanence on the CSS Discuss mailing list.

Every time I read a discussion on CSS Discuss I think that there's actually a JavaScript solution to the problem mentioned there. However, JavaScript is a taboo topic for most CSS developers because they think that you should always use a pure CSS solution. The problem with CSS solutions is that only a small quota of them is easy to implement in a cross-browser way. The remainder is always too complicated to get it work when you need it. When you're in a hurry and you need a fix to a problem, relying only on CSS is a useless waste of time.

CSS developers hate JavaScript but they don't hesitate to use CSS animations which, as a matter of fact, are more similar to behavior than presentation. Still, they hate JavaScript because they think that JavaScript shouldn't handle the visual layout of a web page.

Let's take equal height columns for example. The JavaScript solution is much, much quicker than the CSS solution and requires less adaptations to work properly. That's because JavaScript is a dynamic language and is able to manipulate the structure of a page exactly as you want.

CSS, on the other hand, works mainly on static structures. Once the page structure is constructed, CSS allows you to float or position elements but without altering the underlying backbone of the document.

I've created the date badges of this website with jQuery. Is there a pure CSS solution? Let's try:

div.post h1:before,
div.post.home h2:before {
	content: url(images/date-badge.png);
	display: block;
}

Now the real problem is to exactly position the badge. Further, what about the date? It's clear that such a solution is less feasible than a simpler JavaScript approach.

I think CSS developers hate JavaScript because they hate programming. I don't think jQuery is too complicated to get decent results if you learn to use it properly.

Maybe they're simple afraid of JavaScript because they don't like the idea of doing errors. Well, errors happen even in CSS, so you should get accustomed to the idea of trying something new without worrying too much about the consequences.

You got nothing to lose.