A reasoned response to unreasonable trolls
So, my last post apparently ruffled a few tail feathers. And, there were a number of CSS trolls that crawled out of their caves, clubs swinging wildly. They apparently didn't get the memo that they'd been banished, so against my better judgment, I'd like to address a few of the ideas they brought up.
"You're doing it wrong!", "CSS is the right way...", "You're not following the rules...", "That's not standards compliant"
These are moral and religious arguments, and not based on technical merit. Words like "right", "wrong", "purity", "following rules", "following standards" all convey moral overtones, and are designed to guilt a person into a specific type of behavior. They also appeal to a higher power, which in this case happens to be web standards.
When did designing web pages turn into a religion? I understand that OS's turn into religions 15 years ago, but web pages? Really?
Moral and religious zealotry is fine. But, at least do us all a favor, and be honest enough to recognize that that's what you're doing. Once we all agree that we have techo-religious differences, we can agree to disagree and move on.
"You don't seem to understand. By making your code semanticly pure, you're allowing other programs to fully understand your html markup and fully use the data on your page"
No, I do understand. I understand the whole argument about the semantic web. I understand the appeal of adding meta data and structuring HTML to give it meaning. I happen to think it's a waste of time.
If I want other applications to access my data, I'll give them an API. Otherwise, why should I spend tons of time and effort to make life easier for people trying to scrape my web pages? That's their problem, not mine.
Peter Norvig, VP of research at Google recently said that Google wasn't doing a very good job at doing things with structured data like lists. If Google can't make decent use of structured lists that are already enclosed in ul and li tags, what makes people think that only using a table for tabular data is going to do to bring about the future semantic web?
I happen to think that the semantic web is a pot of gold a the end of a rainbow. If you want to go hunting for it and make all of your HTML semantically pure, go right ahead. I'll pass.
"You haven't spent enough time learning CSS", "Go read a book", "After you're an expert in CSS, it's easy." "No reason for any intelligent person not to use pure CSS"
Most of these are simply ad hominem attacks and can be discounted.
When I need to learn more about CSS, and I will continue to learn it.
At the same time, I'm also upgrading skills in the following areas: system administration, HTTP, Apache configuration and optimization, SQL, PostgreSQL administration, Python programming, and the Django web framework. Oh, and I'm bootstrapping a startup, too.
So, spending 1-2 months learning CSS, just to satisfy someone's idea of a right way to style a page doesn't cut it for me. I already lost 2 weeks, that's enough, thank you. CSS doesn't pay my bill, shipping product does.
I get CSS blocks. I understand the theory behind padding, borders, margins and floats. I just happen to think that the system is helpful for some things and a complete kludge for other things.
Don't just take my word for it. Google seems to agree with me. Amazon agrees with me. Ebay agrees with me. Pray tell, what books should they read about web development? Perhaps the CSS trolls could enlighten them on "The Right Way To Do Things" (tm). Or, perhaps the trolls could stop and ponder for a moment why these huge multi-million dollar corporations haven't gone on board with pure CSS designs.
"Using pure CSS means you'll spend less time in maintenance"
Premature optimization is the root of all sorts of evil. I can always go back and refactor later if needed.
"Do it right the first time"
"Do it the right way." is a moral argument, not a technical one. See response to religious arguments above.
"CSS is faster"
Again, premature optimization is the root of all kinds of evil.
Developer time is expensive, servers are cheap. If it takes me 8 hours extra time to style my site, and my time is worth $100 an hour, that's $800. For $800, I can buy 3 extra Slicehost VPS slices for an entire year.
The performance bottleneck for the vast majority of sites isn't the use of tables for layout. The performance bottleneck is generally the database. On a cost/benefit analysis, I'm going to spend much more time learning database administration than styling. DBA's are expensive, CSS designers are relatively cheap.
At some point, if my company gets as large as ESPN, and I can save terabytes worth of bandwidth by switching to a pure CSS design, I'd be happy to. Right now, it doesn't make sense.
Finally, if site speed was the only issue we're concerned with, we'd all be writing web applications on C, O'Caml, Haskell or Common Lisp. We don't do that, so clearly there are other considerations.
"You can change designs at will. (see CSSzengarden)"
I don't need to change designs at will. I don't want to change designs at will. Adding complexity at the expense of future flexibility doesn't make sense for me right now.
Besides, I'm using Django. It has a robust templating system which lets me modularize my html creation. If I end up using a snippet of html more than twice, I create a template tag that generates that html for me. When I change the design or layout, I can change that snippet of html. The advantages of pure CSS for layout diminish rapidly once you're using a decent templating system that doesn't make you copy and paste html.
"CSS is a solved problem, there is no excuse for not using it"
Um, if it's solved, then why do 75% of Alexa's top 20 still use tables in their designs? What's Google's excuse? Amazon's? I'd really like to hear an answer to that. And, making ad hominem attacks against companies, doesn't count as a decent reason.
For company in ["Amazon", "Yahoo", "Google", "Whatever_company..."]:
.....print "Don't even get me started about %s 's use of web standards." %(company)
>>>*Yawn*
"...use Blueprint, YUI framework, they solve your problems"
Frameworks are workarounds for weaknesses in the system. CSS frameworks were created because styling a standard multi-column design from scratch in CSS is a pain. Yes, they solve certain problems, they don't solve all problems. They certainly didn't solve all my problems.
"Your page won't work well with screen readers"
If this is still a problem, then it's a problem with screen reader technology. Like it or not, people still use tables 19 years into the web. Fix the screen reader technology instead of trying to guilt everybody into changing their sites because of the visually impaired.
Also, if screen readers can't handle tables, then they can't read 75% of the sites on Alexa. Google has Phd level people working on accessiblity. They use tables in their designs. Methinks this argument is overdone.
"CSS lets you adjust your presentation based on mobile browsers or regular browsers"
Most companies that are building mobile friendly sites just make a separate page of mobile screens. Don't believe me, check out Google and Flickr on your iPhone or G1. It's a separate page. It's not a different CSS styling.
If I want to develop a web app for mobile, I'll do the same as Google and Flikr. I'm not going to Frankenstein my CSS to be able to handle anything from at 150px screen to a 1000px screen.
Pure CSS lost the argument.
A lot of us understand the arguments about semantic purity, separation of content and presentation, flexibility of design, increased accessibility and speed.
Problem is we don't care. We've heard you. We've listened to your arguments. We don't buy them. We disagree. We use CSS at times and tables at other times.
And, it's not just me. Apparently, 75% of the top 20 English language sites don't care either. For giggles, go table hunting on a "CSS tutorial" Google search. Half of the sites that have front page ranking for "CSS tutorial" use tables in their layout.
Spend a few hours table hunting the web with the developer toolbar Outline->Outline tables->table cells. The vast majority of the internet has table based layout. It's not just a few angry table holdouts that haven't gotten with the program. We're the silent majority.
With as many nasty comments as people made, no one was able to explain why 75% of Alexa's top 20 still use tables. The conclusion I have to come to is that the CSS purists won a few zealous converts that are rather loud, but for the vast majority of us, they lost the battle. We think that CSS has it's place. It's wonderful for styling text and links uniformly across a site. It's helped make prettier sites the world around. Thank you CSS. We'll use it when we can and when it makes sense. But, we're not going to use it 100% of the time just to be web standards compliant.
So, swing away with your pure CSS clubs. Feel free to condescend. The rest of us will continue to ignore you and go about the business of making the web run.