Tips and tools Alexander Shyrokov on 29 Jan 2008 01:51 pm
A connection between skiing and programming
While skiing with my friends (Zeljko and Andras), I’ve made a statement: “Skiing is an investment for me! Lessons that improve my skiing can be transfered to other areas, for example, programming…”. Surprisingly, my friends were paying close attention to my words and immidietly requested a support for my statements (let’s not point finger at Zeljko). Luckily for me we were already off the chair-lift, and hence there was not time to continue this conversations. After thinking a little bit I found a good illustration (at least I think, it’s good) that supports my statement (after all, I only need a single example that proves my point). So here it is.
We were practicing formation skiing (that’s how we called it), meaning that three of us tried to move as a single entity while skiing down the slope. What I found out is that the major problem with this exersise for us was that attention that we payed to the formation-mates was the attention we did not pay to our own skis… which lead to close encounters with the ground (it did for me). I have found that staying close together made it easier to pay attention to my skis. I explain it by the fact that I did not have to move my head as much, hence the time that otherwise would be spent turning my head around and locating the mates was directed to my skis. This lesson can be abstracted as follows: the fewer or faster the attention shifts that are required to observe parts of an entity, the easier it is it maintain this entity.
One illustration of this lesson in programming is “Declare variables as localy as possible”. In fact, Herb Sutter and Andrei Alexandrescu mention this rule in their book C++ Coding Standards: 101 Rules, Guidelines, and Best Practices (rule 18).
Now the question is “Am I really stretching it?”
Alexander Shyrokov

on 29 Jan 2008 at 5:01 pm 1.Andrew Kun said …
Nice!