{"id":20,"date":"2008-11-25T14:54:00","date_gmt":"2008-11-25T14:54:00","guid":{"rendered":"http:\/\/andypalmer.com\/?p=20"},"modified":"2009-05-22T13:07:24","modified_gmt":"2009-05-22T13:07:24","slug":"forming-good-habits-requires-discipline","status":"publish","type":"post","link":"https:\/\/andypalmer.com\/2008\/11\/forming-good-habits-requires-discipline\/","title":{"rendered":"Forming good habits requires discipline"},"content":{"rendered":"

A long time ago, I went on an advanced driving session. One of the things that my instructor taught me was a mnemonic for checks that you should do before every journey. The mnemonic was POWER[1]<\/a><\/sup>[2]<\/a><\/sup>, which stands for:
\nP<\/span>etrol – (or Phuel for diesel cars) check that you have enough
\nO<\/span>il – Check the dipstick level
\nW<\/span>ater – Check the level in the header tank if you have one
\nE<\/span>lectrics – Headlights, Tail lights, Brake lights, Indicators, Windscreen wipers and washers
\nR<\/span>ubber – Tyres are inflated to the correct pressure, and the tread is within limits<\/p>\n

These checks require very little in the way of skill or time. We should do them at least once per day, and preferably before every journey.
\nI don’t do these checks as often as I should, mainly because they are not habit and forming habits (good or bad) takes time and discipline.
\nIf we were taught these checks as the first part of our driving instruction, it would seem unnatural to not do these checks before every journey. This is called
Primacy<\/a> and states that what is learnt first (good or bad) is hard to unlearn.<\/p>\n

When learning to fly gliders, one of the first things I learned was the pre-flight check. This has the mnemonic CB SIFT CBE<\/a>. To ignore this check would require a significant effort on my part. Even if I have already been through another, more comprehensive checklist, I will still run through this basic test before starting a flight, no matter what the aircraft. This significantly increases my chance of discovering a problem while I am still safe on the ground. Better to be on the ground, wishing you were flying, than to be in the air, wishing you were on the ground.<\/p>\n

I know that writing software test-first leads to a better design and gives me a safety net within which to refactor. I know this in the same way that I know that I should check my oil regularly, but this is not the way that I learned to program. I still sometimes start writing code before I write the tests and find myself wishing I was down there, writing the tests first. It’s a hard habit to break.<\/p>\n

Like the POWER checks, writing code test first is not difficult, it doesn’t take much extra time, and it pays benefits when we uncover problems before they get too serious. Until we unlearn the habit of jumping straight into the driving seat, we need the discipline to do our checks before hand.
\nRight now, I’m going to write two sticky notes. One for my car steering wheel that reads “POWER” and one for my computer monitor that reads “Have you got a test for that?”. <\/p>\n

[1<\/a>]<\/sup>Kent RoSPA Advanced Drivers and Riders<\/a><\/div>\n
[2<\/a>]<\/sup>Up2Speed<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"

A long time ago, I went on an advanced driving session. One of the things that my instructor taught me was a mnemonic for checks that you should do before every journey. The mnemonic was POWER[1][2], which stands for: Petrol – (or Phuel for diesel cars) check that you have enough Oil – Check the […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[16,19,7,17,15],"_links":{"self":[{"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/posts\/20"}],"collection":[{"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":5,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":118,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/posts\/20\/revisions\/118"}],"wp:attachment":[{"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andypalmer.com\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}