Thursday, August 27, 2009

Pondering Software Design, ripping on HTML

In Software you design using various languages. These languages are used to create abstractions, which combined describe your intentions for the computer. These abstractions are arbitrary, just as the words and gramar of language are. However, once you create a language or abstraction, you are bound by its limitations.

So, lets look at a bit at how we program today, specifically web applications. We write code in some primary language (Java, Python, Ruby, php, etc), which generates HTML, which your browser interprets and renders. On top of HTML you also have Javascript and CSS. In addition there are a number of software layers in between (Toolkits/Libraries). Sound confusing? It is...

The problem with the web programming model, is the fundamental separation of your primary language from the browser and its languages. The other problem is that there are so many ways to abstract concepts. The same design can be done within different layers. But the abstractions are always difficult to translate between the layers. The limitations of HTML often force you to do certain design across layers. Part of your user interface design may be done in template languages connected to your primary language, and some of it is HTML. Even if you abstract everything with these template languages you're constantly having to tweak HTML to achieve your desired effect.

So, what's the solution? To cleanly layer the languages and abstractions. HTML never should have been both a rendering layer and a ui abstraction layer. Either it should deal with primitive drawing, or higher order concepts such as form elements, not both!

What's the whole purpose of a browser anyway? Really it's just to preload code and abstractions on the client side so that you don't have to transfer so much data to create the visual effect you want (render an HTML document). We shouldn't be scared of changing these abstractions and improving the way we program.

We have to separate web concepts from web technologies. Certain concepts, such as the link, will forever be part of our technological culture. But the abstract idea of a link is separate from it's implementation (an anchor tag in HTML). HTML is a mess that we can and should discard. Links can be described and created with other languages and technologies. We should focus on finding and developing better languages, abstractions, and tools rather than constantly patching the broken concept that is HTML.

No comments: