As simple as possible, as complex as necessary

The simplicity of Rachel Andrew's "boilerplate"

26 June 2012

Modern front-end web development is complex. While things have become simpler with broad support for standards in current web browsers, we now need to respond to an unpredictable range of browsing devices and contexts, sometimes requiring specific optimisation or adaptation.

The capabilities of browsers are also expanding in terms of the HTML, CSS and Javascript they support, meaning the potential and expectations of what can be done client-side are growing.

Progress is a good thing but can also be overwhelming. It seems that every day some newHotLibrary.js joins the array of frameworks, polyfills and shivs that need to be integrated into any self-respecting web project to address and exploit these challenges and opportunities.

Hence the apparent popularity of boilerplates and bootstraps: pre-packaged bundles of current best practice which can be dropped into the webroot of each new site or app.

Recently, yet another "HTML5 boilerplate" was released to the world by developer and author Rachel Andrew, but you won't find it on GitHub. Here it is:

<!DOCTYPE html>
<meta charset="utf-8" />

This is an extreme form of YAGNI, but as Max Kanat-Alexander makes clear in Code Simplicity, although you may well end up "needing it" (some if not all), the generic solution offered by the boilerplate may not be the best fit for your specific context and requirements, and could adversely affect performance and maintainability unnecessarily.

The point is: you won't know for sure until you come to address the specific problem. That's the time to apply a solution, not before.

Rachel Andrew: Stop solving problems you don't yet have


  • Formatting comments: See this list of formatting tags you can use in your comments.
  • Want to paste code? Enclose within <pre><code> tags for syntax higlighting and better formatting and if possible use script. If your code includes "self-closing" tags, such as <cfargument>, you must add an explicit closing tag, otherwise it is likely to be mangled by the Disqus parser.
Back to the top