My Mother Would Be So Proud

(stackoverflow rep: 10,038, Project Euler 96/283 complete)

(in which it transpires that I’ve been something creative all along)

Perhaps because I don’t speak Swedish very well (for values of “very well” that are exactly equal to “at all”) I didn’t notice this blog post until today, when I came across it in a link from a comment on post in a blog that I do read.

Earlier this week I was struggling to impress upon a colleague that I thought that he should write some code instead of spending additional time “getting a complete understanding of all the issues” and “acquiring a good knowledge of the technical framework”. I wondered if it was some deficiency in my communication “skills” – and that could very well be the case – but I’m starting to think that we have very different views on the purpose of code, perhaps because he’s from an academic mathematical background and I’m just an old hacker. I think he sees the code-writing process as the final expression of his understanding of a problem, where I use code to develop that understanding. Not surprisingly, within our problem domain I think I have the more appropriate model. Anyway, I outrank him…

Maybe it’s an Internet phenomenon (or more likely just human nature) that the same idea (meme?) is rediscovered on a regular basis. I remember reading – and being influenced by – a similar article several years ago. A quick search threw up an even older article making a similar point. Yes, even almost 20 years ago, the transition from source to executable was relatively cheap.

If we view the act of writing source code as part of the design of the program and not part of the build, then we move further away from the commonly-applied physical engineering metaphor and this is no bad thing. It doesn’t take much mental effort: any substantial change in the design of a building is likely to be immensely expensive after the building is constructed, whereas rebuilding a whole program or application is relatively cheap once the design (source) has been updated. Once you get to web apps, where even deployment is almost free, then you’re a long way from the building site.

Further, if we see coding as design, then the notion of starting small and enhancing iteratively, tidying (refactoring) as we go becomes a much more obviously good thing. To my mind, at least.

So – look Ma! I’m a designer!

Advertisements

2 Responses to My Mother Would Be So Proud

  1. Julian says:

    That makes a lot of sense.

    Most fun seems to come from having a rough interesting idea (usually a desired functional outcome that is reasonably focussed and achievable), immediately exploring the definition of that idea in code, and in a short-ish space of time seing some kind of realisation of that idea, which then feeds back to facilitate further re-definition of the idea.

    The problems come when I try to change the design, for it is then that code shows its brittle-ness, and I sometimes feel that part of writing “maintainable” code is really writing code in such a way the the design can be evolved relatively easily (hence refactoring is actually about giving the code a better DNA, to follow the metaphor).

  2. theshagg says:

    You have to be careful how you state these things. Sure, some experimentation is in order, but never advocate the hackers method of just trying stuff until it works. This is how bad code gets worse, why my coworkers are always fighting bugs, why I am always redoing their chicken scratch, etc, etc etc. The result is little scraps of code here and there that do nothing, are redundant, and are completely unreadable, or cause all kinds of wacky behavior once you are off the beaten path of execution path and variable inputs.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: