2007-11-30

Doug Crockford's suggestions on cleaning up HTML

Through Slashdot I found out about Doug Crockford's (creator of JSON) ideas on how to clean up HTML. The suggestions are rather sound. They focus on a security perspective which makes sense as that has caused the web a great amount of pain over the years.

HTML has grown from being a way to mark up documents and their relationships for display purposes to being the container for applications. Quite the transition. =) The suggestions made by Doug seem to be taking the idea of marking up documents and cleaning it up so that it is more in line with defining the components of information.

In a way, one could view all of this as MVC. HTML is the model, where you define how data is stored. The view is CSS which controls the precise presentation of the data. JavaScript is the controller, making sure stuff is manipulated properly between the model and the view. The only twist in this analogy is that HTML as the model also acts as the container for the view and controller (e.g., <script> and <link> tags to pull in JavaScript and CSS), but otherwise the analogy works. And Doug's suggestions seem to support the idea of this separation of concerns, albeit for security reasons.