## Pages

### Hotel room to train carriage

Appeared in the ACCU magazine CVu, Vol 22, January 2011

Paul has asked me to write something for CVu. I don't have a clear idea of what to write about so I thought instead I would just write about stuff I'm doing. Tonight I'm currently sat in a hotel room in Langley (Berks) after a thoroughly excellent day at a client's site. I've been teaching day one of my C Foundation course. John and Ed suggested some ways the slides, and the words I use to describe the slides, could be improved. So the first thing I've been doing is making some mods to the slides. The first was a simple int to pointer conversion where I initialised an int pointer with the hex integer 0xBEEF. I chose 0xBEEF because it spells a word but didn't think about alignment. 0xBEEF is an odd integer number and the address of an integer is likely to be, at the very least, even. The second was something I said. In the chapter about pointers I said that an invalid pointer doesn't have to be dereferenced for bad things to happen. That's too strong. You only need to think about the free() function to realise that. After you've called free(ptr) then ptr no longer points to an object but as long as you don't dereference ptr you'll be ok. What I should have said is that when you do pointer arithmetic any sub-expressions must always be valid.

Something I try to do regularly is to examine what happened during my day and to learn from it. A sort of retrospective. So I'm looking at the C course mods and wondering what I can learn from them. I'm wondering, in the first example, why I chose 0xBEEF in the first place. Choosing a hex number that spells an english word is overly clever. Overly cute. So now I'm thinking I'd be better off choosing a hex number that doesn't remotely even look like a word. One that would align correctly. I'm struck but how hard it is to avoid being overly clever. By how hard it is to recognise and take into account context. From the second example, I'm reminded how hard it is to say clearly what I'm thinking. Or rather, how difficult it is to have sufficient clarity in my thinking that the words are naturally clear.

As well as learning from the day's mistakes it's also important to think about what went well. I recently did a "60 minutes in the brain of" presentation for SkillsMatter London on deliberate practice (the topic of one of my entries in Kevin's 97 Things Every Programmer Should Know). SkillsMatter videod the talk and I've watched it a couple of times. Watching yourself on video is a tremendously valuable thing. It allows you to see yourself how others see you. Not how you see yourself. For example, something I noticed was a tendency I have to say "ok?" rhetorically at the end of a sentence. Ok? Doing that once or twice is fine but I did it perhaps a dozen times. It was almost becoming a tick. So one of my tasks today was to try not to say "ok?" at the end of my sentences. It's hard to know if I achieved that but I at least feel I didn't say it so often it became a noticeable tick. And I recall a couple of times where I was conscious I had not ended the sentence with "ok?" when previously I might have. But, interestingly, as I write this, I'm thinking how can I know? Perhaps I'm still doing it but don't realise because I can't see myself. So I'm wondering if, tomorrow, I will explicitly ask the guys on the course to tell me if I do it. I think I will. I'm reminded of the line from Robert Burns's Poem To a Louse, "To see oursels as others see is!". I remember Jerry Weinberg mentioning the connection in one of his books. And I notice bagpipe music is playing on my iTunes as I write now. I wonder if my subconscious made the scottish connection? It's the Skye Boat Song (Speed Bonny Boat). My mother used to sing that to me as a bedtime lullaby when I was a small boy.

• A trigger is a small amount of input energy that sets off a large amount of output energy.
That caught my interest. I recall Jerry discussing triggers in sone of his other books. So I've made a note to reread what he said about triggers there in the light of that quote. An actual note that is - I also always carry a pen and paper.
• Raise your typing speed by ten words per minute. This will give you an extra six hundred words for every hour you work. If you work an hour a day, two hundred days a year, you'll type an extra 120,000 words - a couple of books' worth.
That's quite illuminating.
• You know, there would be no problem raising kids if only you could throw away the first one.
• Writer's block is not a disorder in you, the writer. It's a deficiency in your writing methods - the mythology you've swallowed about how works get written - what my friend and sometime coauthor Tom Gilb called your 'mythology'.

It took me a while to find that last one. I knew I had read it but I couldn't find it. I searched in the chapter I read most recently. No luck. I flicked through looking at the marked passages. No luck. Then I stopped and thought about what to do next. (It's almost always better than repeating a failed approach.) I wondered if Tom Gilb had an entry in the index. And he did. And it was exactly the passage I remembered. It was on page 19, not anywhere near the chapter I was reading most recently. And it was a passage I'd marked as I read it. And yet I looked at the marked passages trying to find it. I clearly missed it. That's reminded me that I have a tendency to only see something when searching for it if matches my pre-formed idea of what it will look like. My lovely wife Natalie tells me that's a typical male trait. That last snippet about Tom Gilb has sparked something in my mind. Partly I'm attracted to the word myth because one of my favourite corny jokes is the old chestnut "what is a myth?" the answer being "a female moth". But it's more than that. I think it's because my subconscious is connecting the word mythology with the word methodology. That's an interesting connection. A Mythodology perhaps?

Anway, when I've finished reading a book I copy the bits I highlighted into my personal wiki. Then I copy the dozen or so highlights that speak to me the loudest into a small book "review" snippet for my blog site 'Less Code, More Software'. Then I put the book onto a pile to take to the next accu conference to raise some money for charity. We'll be coming into Taunton at moment now so I'm going to sign off.

1. A few notes:

1. Don't try to "not do" something, like the "OK" at the end of sentences when you're teaching. Instead, try to do something else in that situation. So, for example, you could practice nodding your head at the end of each sentence, though that wouldn't be as good as saying something. Why, because you can nod and say "OK" at the same time. If, instead, you say, perhaps, "YES" at the end of sentences, you won't be able to say "OK." And doing it will make you more aware of what you're doing, so although "YES" is almost as bad as "OK," it will tend to extinguish itself. OK?

2. I've just finished putting "Weinberg on Writing" up as an eBook on Smashwords and the Kindle Store (so far). Now you'll be able to search automatically for items whose location you can't remember. Also, you'll be able to highlight and/or tag some passage you want to recall, and also cut and paste it, to save handwriting. (Though handwriting may be a boost to your memory.) OK?

2. And, oh yes. It's another terrific post on your blog, which is one of the few I follow. OK?

p.s. the word verification for this post is "impfun." How appropriate--a wonderful description of your blog. OK?

3. 1. Nodding (silently)
2. Nodding (silently)

Seriously, thank you. I know you've written about not trying to not do something - I've even quoted you on exactly that in a talk I've done on deliberate practice. Now I have a very personal example I feel I've learned it much more deeply - in the Sartre sense of learning.

I've bought a few eBooks (eg Secrets of Consulting) to try it out. Searching is damned useful. I do value writing the snippets out by hand as a memory aid. And I want to have physical copies so I can run the accu charity book stall. Perhaps I should buy books in both formats!

4. > Perhaps I should buy books in both formats!

To my surprise, quite a few people are doing that. - Jerry

5. Perhaps there is a market for offering the eBook to purchasers of paper books for a small amount of money and also vice versa.

The idea of an appropriately chosen word verification is nice isn't it. Another product idea perhaps? It scans the words on the page asking for the verification and makes a suitable word choice based on what it finds.

6. Don't PragProg do that (sell physical + eBook combos for less than their combined independent price)?

7. I've just checked and yes they do.