Press "Enter" to skip to content

Finding Virtue Posts

On non-constructive criticism of populist writers

Provoked by comments on Coding Horror – I Stopped Reading Your Blog Years Ago.

If you are a blog reader: your faith in knowledge is cumulative, so learn how many imprints of a particular “truth” you need before you’re satisfied that it’s a decent reflection of reality. This threshold is your dividing line between entertainment and knowledge.

If you are a blog writer: people either read things because they have to (technical blogs) or because they don’t have to (entertaining blogs). More people read the latter, and the good ones point to the former, forming a useful knowledge ladder. However, attacking the former, whether ad hominen or direct, whether justified or not, does not encourage an uninformed reader to want to read your version of the truth. One thing I’ve yet to see Jeff do is throw his toys out of the pram, yet on nearly every post he makes, there are a series of commenters who do write valuable, technical blogs, who embarass themselves and diminish the exposure of their knowledge by piling in with non-constructive criticism.

On discrete/embedded coding strategies

The programming language should handle the business logic – get the stuff out of the database, make some decisions about it based on the other known factors, and end up with the data you want to display, described in a way which is comprehensible and reusable to the programming language, retaining the metadata obtained through the business logic. (for instance, pageTitle = “You’re Doing It Wrong”; bunchOfArrays = commentID, commentText, userID, userName, commentDate, gravatarID, gravatarCategory) There should be no HTML here (other than perhaps any originally embedded in commentText itself) because *at this stage you don’t even know whether you want to output it as HTML*. Here you are deciding on the data to output and how to describe it.

The data and its descriptors should then be handed over to a module which is capable of transforming it into the output language. Usually for our purposes, this is HTML, but it could easily be a CSV download, an RSS feed, or a bunch of emails. (well, why not?) This can be a templating engine which has templates for different output types, and the only logic it should really engage in is looping through arrays provided to it, i.e. foreach, and what to do when data has not been provided (e.g. a null gravatarID should mean that no img tag is output). There should be no decision making because your first stage has already provided you with all the information needed. If you are a template and are given a single variable, you output it once within the template definition. If you are given an array, you output it several times within the template definition. Here you get to define the order in which the data should be displayed, and the method (markup) you’re using to describe it. (for instance, whether it is *semantically* better to output the userName before or after the commentText, regardless of how you want it to be visually displayed.)

The final stage is presentational, usually in the form of CSS, and takes the structured markup and tells the device how to display it. Here you get to choose the color of the text, whether the userName should visually appear before or after the commentText (not the best example: think of a sidebar and body text; far too many developers output the sidebar and then the body text because the sidebar is being displayed on the left, when it is more accessible to output the body text then the sidebar, and style it so that they’re the other way round) and so on.

The first stage is defined by business logic and turns raw data into parsed data. (database -> decisions -> data+metadata)

The second stage is defined by semantic rules and usability-led, accessibility-led, platform-specific definitions and turns parsed data into structured data. (data+metadata -> output definition -> structured data)

The third stage is defined by presentational rules (design) and turns structured data into “displayed” data. (structured data -> style definition -> output data)

With embedded HTML all this is too difficult so you only offer one output stream, severely limiting your own options in the future. Also, with well designed output, the designer should never need to come back to “ask for another class”. The structured data should already contain enough semantic information in the form of the tag used and the id/class provided, to be able to hang any design elements off a set of CSS selectors.

If you are not designing your application in such a discrete way that a new “corporate image” or a print stylesheet decision only affect the presentational stage, or that a new usability issue only affects the second stage, or that a business decision only affects the first stage, then you are always going to run into trouble.

Visualisation – decline in interest rates

There’s an interesting post at PTS Blog about a chart used in the WSJ to show the decline in interest rates. There are some issues with the visualisation but I think the bigger problem is with using a very selective dataset which may serve more to support the writer’s position rather than reflecting reality. I left some remarks on the blog but here’s a very rough-and-ready view of 3 banks’ rates using a longer time-frame. The past few months do show rapid decline, but set against a different starting point back in 2004, the overall drop is somewhat less significant than the original chart makes out.

Graph showing the rise and then fall of interest rates for the UK, Australian and European central banks from 2004-2008
Graph showing the rise and then fall of interest rates for the UK, Australian and European central banks from 2004-2008


After reawakening this morning and seeing that Senate and House were also blue, I had a funny thought: that we would now be able to move on and start changing the world for the better.  I am from the UK and haven’t considered the USA to be a part of ‘we’ for the past 28% of my life.  Welcome back.


So, we are back, and may good things emerge from it.  A lot has changed in 3 years and a lot will change over the next few months.  I am still figuring it out but hope we get somewhere.