Some days you remember all your life :-)
Hi. I'm Jon Jagger, director of software at Kosli.
I built cyber-dojo, the place teams practice programming.
my first salmon on the fly
Catching, reviving, and releasing my first ever fly caught salmon (from the River Tay at Dunkeld) :-)
A huge thank you to my spey casting instructor and guide (who took the videos)
Gary Scott,
a world champion caster and a fantastically good teacher.
Some days you remember all your life :-)
Some days you remember all your life :-)
amplify & dampen
You know how sometimes the universe seems to be trying to tell you something? I had one of those experiences the other day. I was looking through my notes from the ALE2011 conference keynote Dave Snowden gave. I wrote
A short while later I was reading Surfing the Edge of Chaos and I came across this on page 93
There it was again, amplify & dampen. I was sure this was a theme Jerry Weinberg had written about somewhere but try as I might I couldn't track it down. About an hour or so later I spotted a small red notebook on my bookshelf. I hadn't looked at it in over a year but for some reason I decided to pick it up. On the second page I looked at I'd written the following quote from Quality Software Management, vol 3, Congruent Action on page 95
You know things differently in ordered-systems compared to complex-adaptive-systems. In complex adaptive systems you need discipline, you need safe-to-fail probes. You won't know the effect the probes will have. If the probes have a good effect you need to amplify them. If the probes have a bad effect you need to dampen them. Your strategies for amplifying and damping need to be planned ahead of time.
A short while later I was reading Surfing the Edge of Chaos and I came across this on page 93
The olfactory cells, which provide mammals with their sense of smell, delicately tune receptors to dampen out familiar smells and rapidly amplify receptors with new smells. This is the way the brain is alerted to new dangers or opportunities.
There it was again, amplify & dampen. I was sure this was a theme Jerry Weinberg had written about somewhere but try as I might I couldn't track it down. About an hour or so later I spotted a small red notebook on my bookshelf. I hadn't looked at it in over a year but for some reason I decided to pick it up. On the second page I looked at I'd written the following quote from Quality Software Management, vol 3, Congruent Action on page 95
A basic law of perception is that we tend to minimize small differences (tendency toward assimilation) and to exaggerate appreciable differences (tendency toward contrast). Thus, our perceptions make the world more sharply differentiated than it is, and we're a lot more alike than we are different.
no scaffolding means we're done
Suppose I'm doing the print-diamond kata in cyber-dojo in Java. I start with a test
But suppose you get hit by a bus tomorrow. How easily could your colleagues tell that this code was work in progress? Code that was not finished?
As an experiment I thought I would try an alternative style. One that is not so relaxed about the asymmetry. One that tries a bit harder to be more explicit about distinguishing code that's a temporary step still on the path from code that has reached its destination.
First I wrote a test that expresses the fact that nothing is implemented.
I have unreachable scaffolding.
Time for the scaffolding to come down.
I delete the throw statement.
We're green.
The scaffolding is gone.
We're done.
@Test public void diamond_A() { String[] expected = { "A" }; String[] actual = new Diamond('A').toLines(); assertArrayEquals(expected, actual); }I slime a solution as follows
public class Diamond { private char widest; public Diamond(char widest) { this.widest = widest; } public String[] toLines() { return new String[]{ "A" }; } }now I add a second test
@Test public void diamond_B() { String[] expected = { " A ", "B B", " A ", }; String[] actual = new Diamond('B').toLines(); assertArrayEquals(expected, actual); }and I slime again as follows
public class Diamond { private char widest; public Diamond(char widest) { this.widest = widest; } public String[] toLines() { if (widest == 'A') return new String[] { "A" }; else return new String[] { " A ", "B B", " A ", }; } }Like all techniques this approach has a certain style. In this case there is a small but definite asymmetry between the specificness of the tests (one for 'A' and another one for 'B') and the slightly less specificness of the code (an explicit if for 'A' but a default everything-else for 'B'). This is a style that is relaxed about the asymmetry, a style that emphasises this step as merely one temporary step on the path of many steps leading towards something more permanent. A style that recognises that code, by it's nature, is always going to be more general than tests.
But suppose you get hit by a bus tomorrow. How easily could your colleagues tell that this code was work in progress? Code that was not finished?
As an experiment I thought I would try an alternative style. One that is not so relaxed about the asymmetry. One that tries a bit harder to be more explicit about distinguishing code that's a temporary step still on the path from code that has reached its destination.
First I wrote a test that expresses the fact that nothing is implemented.
@Test(expected = ScaffoldingException.class) public void scaffolding() { new Diamond('Z').toLines(); }I make this pass as follows
public class Diamond { private char widest; public Diamond(char widest) { this.widest = widest; } public String[] toLines() { throw new ScaffoldingException("not done"); } }The scaffolding, as its name suggests, will have to be taken down once the code is done. While it remains, it indicates that the code is not done. Now I start. I add the diamond_A test (as before) and make it pass
public class Diamond { ... public String[] toLines() { if (widest == 'A') { return new String[]{ "A" }; } throw new ScaffoldingException("not done"); } }I add a second diamond_B test (as before) and make it pass
public class Diamond { ... public String[] toLines() { if (widest == 'A') return new String[] { "A" }; if (widest == 'B') return new String[] { " A ", "B B", " A ", }; throw new ScaffoldingException("not done"); } }The scaffolding is still there. We haven't finished yet. Now suppose I refactor the slime (by deliberately duplicating) and end up with this
public class Diamond { ... public String[] toLines() { if (widest == 'A') { String[] inner = innerDiamond(); String[] result = new String[inner.length-1]; int mid = inner.length / 2; for (int dst=0,src=0; src != inner.length; src++) if (src != mid) result[dst++] = inner[src]; return result; } if (widest == 'B') { String[] inner = innerDiamond(); String[] result = new String[inner.length-1]; int mid = inner.length / 2; for (int dst=0,src=0; src != inner.length; src++) if (src != mid) result[dst++] = inner[src]; return result; } throw new ScaffoldingException("not done"); } }The code inside the two if statements is (deliberately) identical so I refactor to this
public class Diamond { ... public String[] toLines() { if (widest == 'A' || widest == 'B') { String[] inner = innerDiamond(); String[] result = new String[inner.length-1]; int mid = inner.length / 2; for (int dst=0,src=0; src != inner.length; src++) if (src != mid) result[dst++] = inner[src]; return result; } throw new ScaffoldingException("not done"); } }Now I add a new test for 'C'
@Test public void diamond_C() { String[] expected = { " A ", " B B ", "C C", " B B ", " A ", }; String[] actual = new Diamond('C').toLines(); assertArrayEquals(expected, actual); }This fails. I make it pass by changing the line
if (widest == 'A' || widest == 'B')to
if (widest == 'A' || widest == 'B' || widest == 'C')Now I remove the if completely
public class Diamond { ... public String[] toLines() { String[] inner = innerDiamond(); String[] result = new String[inner.length-1]; int mid = inner.length / 2; for (int dst=0,src=0; src != inner.length; src++) if (src != mid) result[dst++] = inner[src]; return result; throw new ScaffoldingException("not done"); } }And it no longer compiles.
I have unreachable scaffolding.
Time for the scaffolding to come down.
I delete the throw statement.
public class Diamond { ... public String[] toLines() { String[] inner = innerDiamond(); String[] result = new String[inner.length-1]; int mid = inner.length / 2; for (int dst=0,src=0; src != inner.length; src++) if (src != mid) result[dst++] = inner[src]; return result; } }Now the scaffolding() test fails. I delete that too.
We're green.
The scaffolding is gone.
We're done.
surfing the edge of chaos
is an excellent book by Richard Pascale, Mark Millemann, and Linda Gioja (isbn 0-609-80883-4).
As usual I'm going to quote from a few pages:
As a general rule, adults are much more likely to act their way into a new way of thinking than to think their way into a new way of acting.
Recent study of evolution, both in the natural world and in computer based complex systems, has demonstrated the surprising result that the presence of parasites in a system accelerates evolution dramatically.
The average corporation lives only half as long as the average human being.
The defining feature of a complex adaptive system is its ability to learn.
As the process unfolded, employees repeatedly asked Shapiro to give a more definitive shape to his "vision". He refused to do so. "It will only get in the way," he countered. "People will take it too seriously."
Because we thought our job was to persuade, too often we forgot to listen.
How a system connects with its "external" world is also a key source of that system's health.
Feedback is the means by which a system talks to itself.
Bacteria require three years to circumvent the latest antibiotic; viruses typically outmaneuver vaccines within a year.
Critical to the impact of the [National Training Center] experience is a cadre of 600 instructors, one of whom is assigned to every person with leadership or supervisory responsibilities. These "observers/controllers," as they are called, shadow their counterparts through day after twenty-hour day of intense activity, provide personal coaching, and facilitate a team debriefing called an After Action Review (AAR).
If you awaken with sore muscles, how you feel depends a lot on whether you think you're getting the flu or you believe you are reaping the benefits of a good workout the day before.
progressive fly fishing for salmon
is an excellent book by Alexander Baird Keachie (isbn 1-86126-048-2). As usual I'm going to quote from a few pages:
If you want the maximum pleasure from the sport, be patient, because the more difficult the trade, the longer is the apprenticeship.
On entering freshwater, 90 percent of the retinas [of Coho salmon] are dominated by porphyropsin, or red visual pigment. ... Initial preliminary microspectrophotometric testing of the Atlantic salmon has shown that their retina colour pigmentation closely follow that of the Coho.
In short, when the water level starts falling, or if the water temperature increases, reduce your size of fly. Conversely if the water height increases, or the water temperature takes a downward turn increase your fly size accordingly.
Wood discovered from his fishing that the speed of the fly in relation to its size was of paramount importance. For instance, he found that the only effective way to fish a small fly was to present it at a speed which would be natural to a creature of similar size.
In my opinion most anglers change their flies too often, generally because they lose faith in it. Moreover, when they change flies it is normally for one of a different colour, and not size, and I believe that this is a great mistake.
In fact he [A.H.E. Wood] did not think pattern made much difference, but considered size of much greater importance. J.A. Hutton asked him why he only ever used two flies, a Blue Charm and a Silver Blue. Wood replied that he didn't care which he used. J.A. Hutton then asked him why then he did not use a March Brown, a fly not commonly used at the time for salmon fishing. To this Wood replied that he would use nothing else for the rest of the season, which he did - and took the same number of fish as he would normally have expected to catch during a season.
The main advantage which tube flies have over other flies is that they can be 'queued'; this means you can create a fly of any length, colour, and weight.
Whatever practices you follow when making the 'D' loop, all movements should be continuous and smooth: these will load a rod progressively, while jerky uneven actions cause irregular loading.
ABC
This just caught my eye at breakfast in a hotel.
I had to look up xeriscape. Wikipedia says it means "landscaping and gardening in ways that reduce or eliminate the need for supplemental water from irrigation".
local optimization, global pessimization
A well known UK company, let's called them B&O, sells bidgets and odgets.
B&O sold me a bidget a few years back.
They did a good job. I like the bidget they sold me. It works well.
B&O rings me know-and-then to ask if I'm thinking of buying another bidget or my first odget.
Recently B&O rang me and I mentioned I was indeed thinking of buying an odget to go with my bidget. The B&O person on the other end of the phone sounded very pleased and arranged for a B&O salesman to visit me to provide me with an odget quote. On the designated day, at the designated time, the B&O salesman, let's call him Stan, arrived.
Stan didn't know that someone at B&O had spoken to me on the phone and arranged for Stan to provide me an odget quote. So I explained, for a second time, the odget I was thinking of, and where it would go and how big it would need to be. Stan said that he could quote for the odget, but, being honest, there was no point. Since the odget I was after was not a regular odget B&O would simply subcontract the work to a builder, and then charge me the builder's cost plus a fat markup. Stan said I'd be much better off hiring a builder myself.
Stan explained that the people at the B&O office get a cash bonus each time an odget quote is made to a prospective customer. Stan further explained that they got this cash bonus regardless of whether the customer actually bought the odget. Predictably, the people in the B&O office work hard to get quotes out. They send B&O salesman out to any and all jobs regardless of how likely the job is to result in actual work. Stan said if a B&O phone-handler phoned me to ask whether I'd received a quote, he'd very much appreciate it if I said no I hadn't because I'd changed my mind and didn't want an odget.
Top marks to Stan. No marks to B&O.
Recently B&O rang me and I mentioned I was indeed thinking of buying an odget to go with my bidget. The B&O person on the other end of the phone sounded very pleased and arranged for a B&O salesman to visit me to provide me with an odget quote. On the designated day, at the designated time, the B&O salesman, let's call him Stan, arrived.
Stan didn't know that someone at B&O had spoken to me on the phone and arranged for Stan to provide me an odget quote. So I explained, for a second time, the odget I was thinking of, and where it would go and how big it would need to be. Stan said that he could quote for the odget, but, being honest, there was no point. Since the odget I was after was not a regular odget B&O would simply subcontract the work to a builder, and then charge me the builder's cost plus a fat markup. Stan said I'd be much better off hiring a builder myself.
Stan explained that the people at the B&O office get a cash bonus each time an odget quote is made to a prospective customer. Stan further explained that they got this cash bonus regardless of whether the customer actually bought the odget. Predictably, the people in the B&O office work hard to get quotes out. They send B&O salesman out to any and all jobs regardless of how likely the job is to result in actual work. Stan said if a B&O phone-handler phoned me to ask whether I'd received a quote, he'd very much appreciate it if I said no I hadn't because I'd changed my mind and didn't want an odget.
Top marks to Stan. No marks to B&O.
the house at pooh corner
is an excellent book by A. A. Milne (isbn 1-4052-1117-2). As usual I'm going to quote from a few pages:
'Now,' said Rabbit, 'this is a Search, and I've Organized it - '
'Done what to it?' said Pooh.
'Organized it. Which means - well, it's what you do to a Search, when you don't all look in the same place at once. So I want you, Pooh, to search by the Six Pine Trees first, and then work you way towards Owl's House, and look out for me there. Do you see?'
'No,' said Pooh. 'What -'
'Then I'll see you at Owl's House in about an hour's time.'
'Is Piglet organdized too?'
'We all are,' said Rabbit, and off he went.
Pooh was sitting in house one day, counting his pots of honey, when there came a knock at the door. 'Fourteen,' said Pooh. 'Come in. Fourteen. Or was it fifteen? Bother. That's muddled me.'
Pooh hadn't thought about it at all, but now he nodded. For suddenly he remembered how he and Piglet had once made a Pooh Trap for Heffalumps, and he guessed what had happened. He and Piglet and fallen into a Heffalump Trap for Poohs! That was what it was.
And he respects Owl, because you can't help respecting anybody who can spell TUESDAY, even if he doesn't spell it right; but spelling isn't everything.
it suddenly came over him that nobody had ever picked Eeyore a bunch of violets, and the more he thought of this, the more he thought how sad it was to be an Animal who had never had a bunch of violets picked for him.
Rabbit came up importantly, nodded to Piglet, and said, 'Ah Eeyore,' in the voice of one who would be saying 'Good-bye' in about two more minutes.
and the big one came out first, which was what he had said it would do, and the little one came out last, which was what he had said it would do, so he had won twice... and when he went home for tea, he had won thirty-six and lost twenty-eight, which meant that he was - that he had - well, you take twenty-eight from thirty-six, and that's what he was. Instead of the other way around.
'They always take longer than you think,' said Rabbit.
'And I was here myself a week ago.'
'Not conversing,' said Eeyore. 'Not first one and then the other. You said "Hallo" and Flashed Past. I saw your tail a hundred yards up the hill as I was meditating my reply. I had thought of saying "What?" - but, of course, it was then too late.'
'Well, I was in a hurry.'
'No Give and Take,' Eeyore went on. 'No Exchange of Thought. "Hallo - What" - mean, it gets you nowhere, particularly if the other person's tail is only just in sight for the second half of the conversation.'
Christopher Robin was telling them what to do, and Rabbit was telling them again directly afterwards, in case they hadn't heard, and then they were all doing it.
'And what about the new house?' asked Pooh.
'Have you found it, Owl?'
'He's found a name for it,' said Christopher Robin, lazily nibbling at a piece of grass, 'so now all he wants is the house.'
He had to write this out two or three times before he could get the rissolution to look like what he thought it was going to when he began to spell it;
'Don't Bustle me,' said Eeyore.
The fact is this is more difficult than I thought,
the silent language
is an excellent book by Edward T. Hall (isbn 0-385-05549-8).
As usual I'm going to quote from a few pages:
Culture hides much more than it reveals, and strangely enough what it hides, it hides most effectively from its own participants.
Interaction has its basis in the underlying irritability of all living substance.
Culture is saturated with both emotion and intelligence.
Theodosius Dobzhansky, the great human geneticist, once observed that life was the result of neither design nor chance but the dynamic interaction of living substance with itself. He meant that life, in a changing environment, places such strains on the organism to adapt that, if this does not take place constantly, the organism as a species dies out.
Different cultures are analogous to different species in the sense that some of them survive whilst others perish. Some are more adaptive than others. The study of change, therefore, is the study of survival.
An often noted characteristic of culture change is that an idea or a practice will hold on very persistently, apparently resisting all efforts to move it, and then, suddenly, without notice, it will collapse.
The idea of looking at culture as communication has been profitable in that it has raised problems which had not been thought of before and provided solutions which might not otherwise have been possible.
We say, "I'll see you in an hour." The Arab says, "What do you mean, 'in an hour'? Is the hour like a room, that you can go in an out of it?" To him his own system makes sense: "I'll see you before one hour," or "I'll see you after one week." We go out in in the rain. The Arab goes under the rain.
...we all hold an illusion about talking, an illusion that talking is quite untrammeled and spontaneous and merely 'expresses' whatever we wish to have it express. This illusory appearance results from the fact that the obligatory phenomena within apparently free flow of talk are so completely autocratic that the speaker and the listener are bound unconsciously as though in the grip of a law of nature. [Benjamin Whorf, Linguistics as an Exact Science]
Complete lack of congruence occurs when everything is so out of phase that no member of a culture could possibly conceive of himself creating such a mess.
Many artists... are credited with "creating" new patterns. Yet most artists know that what greatness they have lies in being able to make meaningful statements about what is going on around them. They say what others have tried to say but say it more simply, more directly, and more accurately, more incisively and with greater insight.
Talking about them... changes our relation with them. We move into an active and understanding correspondence with those aspects of our existence which are all too frequently taken for granted or which sometimes weigh heavily on us. Talking about them frees us from their restraint.
Subscribe to:
Posts (Atom)