A Single Article
Read it, comment, and share it with your friendsSeparation
I was avoiding going to sleep (and still am) when I read a post by Jeff Croft titled The Myth of Content and Presentation Separation. To quote him, Jeff said:
But the idea that a redesign of anything more than the most basic of sites will not require changes to (X)HTML markup is simply a myth.
… which is entirely correct. The only thing I’m left wondering, though, is… did people not know this already? To quote one commenter:
I love the fact you stood up and said this!
Come on, seriously? The sky is blue, the grass is green, and redesigns almost always involve changing multiple layers of data. Working on websites for 10 minutes made this pretty obvious to me, but I guess I can see where people might have been mislead, when according to Jeff:
One key real-world benefit of this separation is that come redesign time, one only needs to change or replace the CSS stylesheet, and needn’t lay so much as a finger upon the hallowed grounds we call markup.
This was something that was being paraded around as one of the benefits of CSS a few years back when web standards were almost cool, but I think everyone misunderstood the point. I don’t think anyone meant to say that a redesign of a site would involve only changing the CSS files… that’s silly. Redesigns can entail rebuilding the backend, optimizing scripts, changing the content, and giving a site a new look, all goals that involve changing different layers of data. I don’t think anyone was ever meant to prevent that. I think the idea that was meant to be conveyed was that, when you want to change something about a site’s appearance, you can do so in the CSS without messing with the HTML. And when you want to change something about the content, you can do so in the HTML without messing with the CSS. I think anyone can understand that… it’s all about the separation.
And let me say, right here and now, that separation is the most important and useful and reliable thing one can do when building websites. I have suffered numerous head-to-desk moments in the past year when I have had to deal with sites that were developed without separation in mind. When you open up a script for a webpage and find PHP, HTML, Javascript, and CSS code all mixed and intertwined and tangled together, and you spend the majority of your time just trying to decipher things and figure out what does what, it becomes really obvious that the various data layers in a website should be kept separate. This is why I put my Javascript and CSS in separate files. It’s all about keeping files small and organized, and knowing where to find things when something needs to be changed.
I’d like to say that this is common knowledge and I’m just “preaching to the choir” here, but I’ve seen far more badly-written code than good code in my life, and I’m just hoping that some of those people who terrorized my life with their messy code will read this post and rethink the way they do things. Yeah, you. Write clean code. You’ll be glad you did.
I’m off to sleep.
Get a Trackback link
4 Comments
Responses to my articleI was gonna say, “Are we having fun on yet (on a new project maybe)?”, but I think I’ll just go with, “sweet dreams”.
I need to go get some myself - at least I just knocked out my feeds for the morning
Could not agree with you much more than with what you have already said.
Some times you can get lucky to only change the CSS but most times as you say you will need to edit the ‘markup’. I guess some people are still learning that fact ;rolls:
BillyG: When I’m really tired, I don’t dream at all. Lately it’s been nothing but short, dreamless nights.
Jermayn: Did you mean :rolls: ?
Yeah :rolls:
Leave a comment
Share your thoughts with the worldYou can use Markdown, or you can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>Please keep comments respectful and on topic.
This form is guarded by Akismet, so don't waste your time trying to submit spam. It won't work. Ever.