We choose, in this decade, to banish instantiation

From this day forth, I can confirm the new programming paradigm will be:


# ********************************************************************
# TRASHY LITTLE SUBROUTINES
# ********************************************************************

As found in the Lunar Landing Guidance Equations of the Apollog Guidance Computer,

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

We

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.

And so it begins

Time to get settled in.  Turn all your TVs to different news channels, reprogramme your multi-remote to switch audio between them, open at least 82 Firefox tabs, and hunker down!

Places to watch:

Making Light- Discussion hosted by Bruce Security Schneier
TPM have a dynamically updating dashboard

Edit: Daily Kos have a nice map too
Good luck all; the turnout at least looks promising.

Random: Tool “Remix”

It’s an abberation, and an insult.

But I was told to do it, and so I comply.

Tool – Eulogy (Lyxi Mix #10)

The brief: mix Lateralus with ITV’s Rainbow. Near impossible, feel. So the secondary was: Eulogy mixed with the theme tune of Cities of Gold. I hope I’ve achieved this, and yet destroyed the beautiful song even further by splicing all sorts of nonsense from my wife’s wav collection.

Oh the terrible days we own. I apologise, I understand, and will maintain. This is like jazz; everything remains, for better or for worse. It’s better this way; we can at least reflect, and say sorry – one day. You talking to me? 😉

Random: My Friend’s Wedding

Congratulations to another friend who is due to be married next Saturday – may it be filled with happiness and joy, and the subsequent years be … OKish.. 😉

For this, we prepared the George MacPherson Wedding March, which prepared thee for his stag night, and which shall torment him further and hopefully last as a telling reminder for the madness which can occur.

Good luck, and all the best, friend.

Single: Cruciform

Purposefully distorted, another one take output taking about two hours from start to finish, including searching for “free” acapellas to use! Lyrics thanks to Future Breeze and Virtual Darkness for providing the acapella version. Everything else thanks to a demo version of Sytrus, and a demo version of FL Studio. For a change.

  1. Cruciform (featuring Future Breeze)
  2. Cruciform (Instrumental)