• Home
  • About

Mark Fletcher's Blog

Occasional posts about startups, skiing, and perhaps chickens

Feeds:
Posts
Comments
« Notes From The Bleeding Edge
New Bloglines Features »

Web Programming Theory

February 16, 2004 by MarkF

Warning, this is a nerdy post. Moreso than normal even.
As I was visiting a site this morning that was having problems and spitting out random PHP error messages, I was reminded that I wanted to write up something about web programming. No I’m not going to name the site, but they should know better. And this is not a post bashing PHP, because like many things PHP can be used for good as well as evil.
During one of our web redesigns at ONElist , a couple of our very smart engineers developed a new templating system, called CS/HDF, named after the two types of files that are involved. Later, Dave Jeske and Brandon Long wrote an open-source version of CS/HDF, called Clearsilver. It’s an excellent implementation, and it’s what we use for Bloglines.
I won’t go into explaining how Clearsilver works; the web site’s got some pretty good docs in that regard. But I want to mention the design philosophy of the system. Basically, Clearsilver forces the developer to seperate application logic from the presentation layer. What does that mean? Before Clearsilver is given the chance to build a web page, all variables required for building that web page are populated. Once Clearsilver takes over, no additional data is input, no database calls are made, nothing. By the time that Clearsilver is processing the page, the application knows whether it was able to fetch all the data and whether there were any errors in processing it.
How is this good? A couple of reasons. First, since the display layer is already extracted, it’s very easy to redesign the look of or internationalize the web site. No need to worry about messing up any application logic while editing templates. Also, there will never be any mysterious error messages showing up in the middle of the page whenever something fails. By the time the template is processed you know for certain whether you have all the information you need to display the page. That makes it easier to craft error dialogs. Ever been surfing a web site, and you see half the page come up, and then wait 30 seconds for the rest of the page to complete? That happens when the data required for the web page is fetched after the page has started to display. That makes it much more difficult to craft good error dialogs. If I want the look of the page to completely change if there’s an error, I can’t do that if I find out about the error after half the page has already been sent to the client web browser.
Again, I’m not bashing PHP. I believe you can program in this style using PHP as well, but it’s not enforced. The language is not important (although Clearsilver is very good and deserves more recognition). The seperation of application logic from display is what matters.

Advertisement

Like this:

Like
Be the first to like this post.

Posted in Tech | Leave a Comment

  • Recent Tweets

    • Found one of the chickens dead in the coop. Bummed. 1 day ago
    • Checking out @pinterest. They copy/host images from elsewhere on the web. People are ok with that? 4 days ago
    • "We are calling you to update your Google profile. Please press 1 to update your profile on Google and other search engines." UGH. 4 days ago
    • Just finished season 4 of Breaking Bad. That show is amazingly awesome. I can't say enough good things about it. 5 days ago
    • Yay, the chickens have started laying eggs again. 1 week ago
  • Elsewhere

    • The ONElist File
  • Founder

    • Bloglines
    • ONElist
  • Investor/Consultant

    • One True Media
    • Plaxo
    • Techdirt
    • Wesabe
  • Archives

    • July 2010 (2)
    • May 2010 (4)
    • April 2010 (10)
    • January 2009 (1)
    • November 2008 (1)
    • October 2008 (1)
    • July 2008 (1)
    • June 2008 (2)
    • April 2008 (4)
    • March 2008 (4)
    • February 2008 (5)
    • January 2008 (5)
    • December 2007 (8)
    • November 2007 (4)
    • September 2007 (1)
    • August 2007 (3)
    • July 2007 (1)
    • June 2007 (4)
    • May 2007 (3)
    • April 2007 (2)
    • March 2007 (2)
    • February 2007 (2)
    • January 2007 (2)
    • December 2006 (2)
    • November 2006 (2)
    • October 2006 (2)
    • September 2006 (1)
    • August 2006 (1)
    • June 2006 (5)
    • May 2006 (2)
    • April 2006 (3)
    • March 2006 (1)
    • February 2006 (1)
    • January 2006 (1)
    • December 2005 (5)
    • October 2005 (2)
    • September 2005 (1)
    • August 2005 (1)
    • July 2005 (1)
    • June 2005 (6)
    • May 2005 (7)
    • April 2005 (1)
    • March 2005 (2)
    • February 2005 (5)
    • January 2005 (1)
    • December 2004 (3)
    • November 2004 (1)
    • October 2004 (4)
    • September 2004 (7)
    • August 2004 (6)
    • July 2004 (7)
    • June 2004 (7)
    • May 2004 (7)
    • April 2004 (6)
    • March 2004 (6)
    • February 2004 (11)
    • January 2004 (9)
    • December 2003 (5)
    • November 2003 (7)
    • October 2003 (4)
    • September 2003 (3)
    • August 2003 (2)
    • July 2003 (11)
    • June 2003 (1)
    • May 2003 (1)
    • April 2003 (2)
    • March 2003 (6)
    • February 2003 (2)
    • January 2003 (8)
    • December 2002 (1)
    • November 2002 (4)
    • October 2002 (5)
    • September 2002 (5)
    • August 2002 (2)
    • July 2002 (1)
    • May 2002 (1)
    • April 2002 (2)
    • March 2002 (7)
    • February 2002 (4)
    • January 2002 (4)
    • December 2001 (1)
    • November 2001 (3)
    • October 2001 (3)
    • September 2001 (7)
    • August 2001 (10)

Blog at WordPress.com.

Theme: MistyLook by Sadish.


Follow

Get every new post delivered to your Inbox.

Powered by WordPress.com