Here's the slide-deck on pair-programming I recently presented for a client.
Hi. I'm Jon Jagger, director of software at Kosli.
I built cyber-dojo, the place teams practice programming.
Showing posts with label communication. Show all posts
Showing posts with label communication. Show all posts
management 3.0
is an excellent book by Jurgen Appelo, subtitled Leading agile developers, Developing agile leaders (isbn 978-0-321-71247-9).
As usual I'm going to quote from a few pages:
The hierarchy is needed for authorization; the network is needed for communication.
Big species consume more and breed slower.
The Red Queen's Race is an evolutionary hypothesis describing that a complex system needs continuous improvement to simply maintain its current fitness, relative to the systems it is co-evolving with. Some scientists claim that the Red Queen's Race, or the principle of co-evolving species, is an even more important driver of evolution that any other kind of environmental change.
We can consider the internal structure of each system to be a code for the environment and the other species that it is evolving with.
There is no accurate (or rather, perfect) representation of a system which is simpler than the system itself.
We can figure out why the human heart fails (reductionism) but we can never create a heart that won't fail (constructionism).
Managers must learn that they are "in charge" but not "in control".
Recent research has shown that the copying of ideas is the most successful of all strategies.
Uncertainty results in a bias towards self-interest.
Feedback is only feedback when there is a purpose behind it.
Research shows that self-discipline is twice as important as IQ for final grades of students. Effort matters more than talent.
Focus on delivering value.
We need continuous business improvement.
communicating
Back to quotes table-of-contents
From The Systems Bible
From Managing the Design Factory
From The Pleasure of Finding Things Out
From Management of the Absurd
From eXtreme Programming explained
From The Road Less Travelled and Beyond
From Situated learning - Legitimate peripheral participation
From Quality Software Management. Vol 1. Systems Thinking
From The Mind of War
From The Starfish and the Spider
From An Ecology of Mind
From Quality Software Management. Vol 2. First-Order Measurement
From The Psychology of Computer Programming
From how to use conscious purpose without wrecking everything
From Wisdom of the idiots
From The Systems Bible
The meaning of a communication is the behaviour that results.
Information theory is a mathematical treatment of what is left after the meanings have been removed from a Communication.
From Managing the Design Factory
Whenever we see an intense need for communications it is typically a sign that the system has been incorrectly partitioned.
From The Pleasure of Finding Things Out
Official management, on the other hand, claims to believe the probability of failure is a thousand times less. One reason for this may be an attempt to assure the government of NASA perfection and success in order to ensure the supply of funds. The other may be that they sincerely believe it to be true, indicating an almost incredible lack of communication between themselves and their working engineers.
From Management of the Absurd
It is only when the balance of power is relatively equal that truly candid communication can and should take place.
From eXtreme Programming explained
XP is a communal software development discipline.
From The Road Less Travelled and Beyond
Community has to do with communication.
From Situated learning - Legitimate peripheral participation
A learning curriculum is thus characteristic of a community.
From Quality Software Management. Vol 1. Systems Thinking
The quickest and surest way to classify organisations into similar patterns is by the way people think and communicate.
From The Mind of War
Oral, not written, communication and conviction, not accuracy, still rule in military culture.
The tendency is for entropy to increase in a system that is closed or cannot communicate with the external systems or environments.
From The Starfish and the Spider
I taught them that communication is to be upward if it is to work at all.
From An Ecology of Mind
Without context, words and actions have no meaning at all. This is true of all communication.
From Quality Software Management. Vol 2. First-Order Measurement
Large projects always fail when their communication systems fail.
From The Psychology of Computer Programming
The greatest challenge, then, is not creative thinking, but creative communicating: representing our thoughts in a way that other persons - each with a unique style - can understand.
From how to use conscious purpose without wrecking everything
Once you get above that first level, the level of material things and forces, you are dealing with abstractions. In place of physical forces, you have communication—messages, signals. And in place of material things, you have relationships—which are abstractions.
From Wisdom of the idiots
Words alone do not communicate: there must be something prepared, of which the words are a hint.
the pleasure of finding things out
is an excellent book by Richard Feynman (isbn 978-0-141-03143-9). As usual I'm going to quote from a few pages:
Looking at the bird he says, "Do you know what that bird is? It's a brown throated thrush; but in Portuguese it's a … in Italian a …, " he says "in Chinese it's a …, in Japanese a …," etcetera. "Now," he says, "you know in all the languages you want to know what the name of the bird is and when you've finished with all that," he says, "you'll know absolutely nothing whatever about the bird. You only know about humans in different places and what they call the bird. Now," he says, "let's look at the bird."
I said, "Say, Pop, I noticed something: When I pull the wagon the ball rolls to the back of the wagon, and when I'm pulling it along and I suddenly stop, the ball rolls to the front of the wagon," and I says, "why is that?" And he said, "That nobody knows," he said. "The general principe is that things that are moving try to keep on moving and things that are standing still tend to stand still unless you push on them hard." And he says, "This tendency is called inertia but nobody knows why it's true." Now that's a deep understanding - he doesn't give me a name, he knew the difference between knowing the name of something and knowing something, which I learnt very early.
To do high, real good physics work you do need absolutely solid lengths of time.
You cannot expected old designs to work in new circumstances.
If you are in a hurry, you must dissipate heat.
We had lots of fun.
The people underneath didn't know at all what they were doing. And the Army wanted to keep it that way; there was no information going back and forth... I felt that you couldn't make the plant safe unless you knew how it worked… I said that the first thing there has to be is that the technical guys know what we're doing. Oppenheimer went and talked to the security people and got special permission. So I had a nice lecture in which I told them what we were doing, and they were all excited. We're fighting a war. We see what it is. They knew what the numbers meant. If the pressure came out higher, that meant there was more energy released and so on and so on. They knew what they were doing. Complete transformation! They began to invent ways of doing it better. They supervised the scheme. They worked all night. They didn't need supervising at night. They didn't need anything. They understood everything. They invented several of the programs that we used and so forth. So my boys really came through and all that had to be done was to tell them what it was, that's all. It's just, don't tell them they're punching holes. As a result, although it took them nine months to do three problems before, we did nine problems in three months.
Most of the trouble was the big shots coming all the time and saying you're going to break something, going to break something.
We used to go for walks often to get rest.
Advertising, for example, is an example of a scientifically immoral description of the products.
The magnetic properties on a very small scale are not the same as on a large scale.
But what we ought to be able to do seems gigantic compared with our confused accomplishments. Why is this? Why can't we conquer ourselves?
Erosion and blow-by are not what the design expected. They are warnings that something is wrong. The equipment is not operating as expected, and therefore there is a danger that it can operate with even wider deviations in this unexpected and not thoroughly understood way… The O-rings of the Solid Booster Rockets were not designed to erode. Erosion was a clue that something was wrong. Erosion was not something from which safety can be inferred.
We have also found that certification criteria used in Flight Readiness Reviews often develop a gradually decreasing strictness.
The computer software checking system and attitude is of highest quality. There appears to be no process of gradually fooling oneself while degrading standards so characteristic of the Solid Rocket Booster or Space Shuttle Main Engine safety systems. To be sure, there have been recent suggestions by management to curtail such elaborate and expensive tests as being unnecessary at this late date in Shuttle history. This must be resisted for it does not appreciate the mutual subtle influences, and sources of error generated by even small changes of one part of a program on another. There are perpetual requests for changes as new payloads and new demands and modifications are suggested by the users. Changes are expensive because they require extensive testing. The proper way to save money is to curtail the number of requested changes, not the quality of testing for each.
Official management, on the other hand, claims to believe the probability of failure is a thousand times less. One reason for this may be an attempt to assure the government of NASA perfection and success in order to ensure the supply of funds. The other may be that they sincerely believe it to be true, indicating an almost incredible lack of communication between themselves and their working engineers.
It is presumptuous if one says, "We're going to find the ultimate particle, or the unified field laws," or "the" anything.
driving in India
Patterns of Software by Richard Gabriel is one of my favourite books. On page 60 he quotes
Christopher Alexander
(who is talking about D'Arcy Thompson)
The most obvious thing that strikes me when I visit Bangalore or Chennai is the almost constant horn tooting. Is tooting your horn a formally taught behaviour, or is it learned behaviour I wondered. I asked some friends who live in India. They said it is not something you're taught. It is learned behaviour. I find this fascinating. It could mean that at some point in past tooting was common, but not endemic, and that for some reason or reasons it reached a tipping point and became endemic. What are those reasons? Why did they prevail? Do those reasons apply to all Indian cities or are some quieter than others? Do the reasons shed any light on whether endemic horn tooting will or won't ever go away?
A pattern I started to sense during my most recent trip is when a slow vehicle is stuck behind an even slower vehicle (a bus for example) and toots the horn as if to say "move over". The bus slowly moves over, the first vehicle passes it, and as it goes by toots twice, the first toot to say "thank" and the second toot to say "you". I never got the sense the tooting was overtly aggressive. I think drivers are tooting mostly to tell other drivers where they are. Considering the apparent chaos everyone is remarkably relaxed! The tooting has become part of a system of communication.
Naturally, once certain behaviours get a foothold, other behaviours adapt to them, helping to reinforce the co-evolving system. Drivers of slow vehicles start to rely on other drivers tooting them if they want to pass. They politely ask people to toot them by painting "Blow horn" signs on the backs and sides of their trucks. Artistic individuals spot an opportunity and, for a small fee, offer to paint ever more elaborate "Horn please" signs. Before you know it Volkswagen pre-fits cars it sells in India with slightly louder electromechanical horns. Now some truck drivers don't move over unless they're tooted and you have to toot if you want to pass. Viola. A co-evolving, intertwingled, history. Things are the way they are because they've got that way.
Large potholes in the road are common. Roads in India don't really have left lanes and right lanes so much as worse lanes and better lanes. I certainly don't recall seeing any white-line lane-dividers. What looks like total lane switching "indiscipline" is again simply sensible adaptive driving.
If traffic moved very fast the frequent lane switching would be downright dangerous. But traffic doesn't move fast. One reason is simply that lots of the traffic is old. Driving a new car in a sea of old cars could be quite dangerous (because of the brakes). Perhaps that's partly why the roads are regularly punctuated with pretty severe speed-bumps (actual ones as well as the pot holes). The speed-bumps keep your speed low even if you have a new car. So why buy a more expensive new car? Things are the way they are because they've got that way.
The traffic is also very varied. There are trucks, buses, masses of 3 wheeler took-tooks, huge numbers of motorbikes, push-bikes, push-trikes, pedestrians, carts, cows, you name it. As the traffic constantly switches lanes spaces of varying sizes constantly appear. No matter what the size of the space, there is always some form of road user just the right size to fill it. The variety encourages lane switching and the lane switching encourages variety. It gets that way.
Another reason traffic crawls is sheer numbers. More than a billion people Iive in India. There's a lot of traffic because there's a lot of people. And a lot of those people are young people. According to Wikipedia more than 50% of the Indian population is below the age of 25! The average middle-class home in a city such as Chennai is about 20 times the average middle class salary. Combine that with 10%+ interest rates and it's easy to see that a lot of people cannot afford to live in the city where they work. With so many young people, a hot climate, and a urban army of forced commuters it's no wonder there are so many motorbikes and buses, and increasingly, small cars. Things are the way they are because they got that way.
And a system that has got a certain way will, all things being equal, want to stay that way. A system will resist change. That's virtually a definition of a system. Only by resisting does it sit still long enough to be recognisable as something at all!
What Thompson insisted on was that every form is basically the end result of a certain growth process. ... Thompson was saying that everything is the way it is today because it is the result of a certain history - which of course includes how it got made. At the time I read this I did not really understand it very well; whereas I now realize that he is completely right.I'll use an example to try and illustrate this idea of, as Jerry Weinberg puts it, things being the way they are because they got that way. The example is driving in India.
The most obvious thing that strikes me when I visit Bangalore or Chennai is the almost constant horn tooting. Is tooting your horn a formally taught behaviour, or is it learned behaviour I wondered. I asked some friends who live in India. They said it is not something you're taught. It is learned behaviour. I find this fascinating. It could mean that at some point in past tooting was common, but not endemic, and that for some reason or reasons it reached a tipping point and became endemic. What are those reasons? Why did they prevail? Do those reasons apply to all Indian cities or are some quieter than others? Do the reasons shed any light on whether endemic horn tooting will or won't ever go away?
A pattern I started to sense during my most recent trip is when a slow vehicle is stuck behind an even slower vehicle (a bus for example) and toots the horn as if to say "move over". The bus slowly moves over, the first vehicle passes it, and as it goes by toots twice, the first toot to say "thank" and the second toot to say "you". I never got the sense the tooting was overtly aggressive. I think drivers are tooting mostly to tell other drivers where they are. Considering the apparent chaos everyone is remarkably relaxed! The tooting has become part of a system of communication.
Naturally, once certain behaviours get a foothold, other behaviours adapt to them, helping to reinforce the co-evolving system. Drivers of slow vehicles start to rely on other drivers tooting them if they want to pass. They politely ask people to toot them by painting "Blow horn" signs on the backs and sides of their trucks. Artistic individuals spot an opportunity and, for a small fee, offer to paint ever more elaborate "Horn please" signs. Before you know it Volkswagen pre-fits cars it sells in India with slightly louder electromechanical horns. Now some truck drivers don't move over unless they're tooted and you have to toot if you want to pass. Viola. A co-evolving, intertwingled, history. Things are the way they are because they've got that way.
Large potholes in the road are common. Roads in India don't really have left lanes and right lanes so much as worse lanes and better lanes. I certainly don't recall seeing any white-line lane-dividers. What looks like total lane switching "indiscipline" is again simply sensible adaptive driving.
If traffic moved very fast the frequent lane switching would be downright dangerous. But traffic doesn't move fast. One reason is simply that lots of the traffic is old. Driving a new car in a sea of old cars could be quite dangerous (because of the brakes). Perhaps that's partly why the roads are regularly punctuated with pretty severe speed-bumps (actual ones as well as the pot holes). The speed-bumps keep your speed low even if you have a new car. So why buy a more expensive new car? Things are the way they are because they've got that way.
The traffic is also very varied. There are trucks, buses, masses of 3 wheeler took-tooks, huge numbers of motorbikes, push-bikes, push-trikes, pedestrians, carts, cows, you name it. As the traffic constantly switches lanes spaces of varying sizes constantly appear. No matter what the size of the space, there is always some form of road user just the right size to fill it. The variety encourages lane switching and the lane switching encourages variety. It gets that way.
Another reason traffic crawls is sheer numbers. More than a billion people Iive in India. There's a lot of traffic because there's a lot of people. And a lot of those people are young people. According to Wikipedia more than 50% of the Indian population is below the age of 25! The average middle-class home in a city such as Chennai is about 20 times the average middle class salary. Combine that with 10%+ interest rates and it's easy to see that a lot of people cannot afford to live in the city where they work. With so many young people, a hot climate, and a urban army of forced commuters it's no wonder there are so many motorbikes and buses, and increasingly, small cars. Things are the way they are because they got that way.
And a system that has got a certain way will, all things being equal, want to stay that way. A system will resist change. That's virtually a definition of a system. Only by resisting does it sit still long enough to be recognisable as something at all!
an ecology of mind
is an excellent dvd, by Nora Bateson, about her father, Gregory Bateson, who wrote
An Ecology of Mind.
As usual here's are some selected quotes:
Without context, words and actions have no meaning at all. This is true of all communication... [Gregory Bateson]
A role is a half-arsed relationship. It's one end of a relationship. You cannot study only one end of a relationship and make any sense. What you will make is disaster. [Gregory Bateson]
I've been bothered a little bit the past few days by people who say, "What do you mean 'ecology of mind'". And approximately what I mean is that the various sorts of 'stuff' that goes on in ones heads and in ones behaviour, and dealing with other people and walking up and down mountains, and getting sick and getting well and all that. That all that stuff interlocks, and in fact constitutes a network, and you've got the sort of complicated, living, partly struggling, partly co-operating, tangle, that you find on the side of any of these mountains with the trees and various plant and animals that live there. In fact an ecology. [Gregory Bateson]
The division of things into parts tends to be a device of convenience, and that's all. [Gregory Bateson]
Wise men see outlines and therefore they draw them. [William Blake]
Madmen see outlines and therefore they draw them. [William Blake]
If a fool should persist in his folly, he would become wise [William Blake]
The difference that makes a difference is a way in which to define something in terms of its relationships, using contrast and context, instead of isolating it with a name. [Nora Bateson]
Krishnamurti said something like "You might think you're thinking your own thoughts. You're not. You're thinking your culture's thoughts." [Nora Bateson]
I guess I've been reading too much Alice. [Gregory Bateson]
The double-bind is a creative imperative. Its the moment when, because this doesn't work and that doesn't work, something else is going to have to be improvised. A creative impulse is necessary at that moment, to get out of the situation, to take it up a level. [Nora Bateson]
The combination of theme with variation immediately points you to something behind it. A formative principle. [Terrence Deacon]
He was often accused of talking in riddles and never coming to the point. The question he posed "What is the pattern that connects?" was never meant to be answered, because the patterns are changing. It was the act of questioning that he was pushing for. Knowing that the eyes behind that curiosity will be the most apt to give the patterns of connection room to wiggle as they perpetually self correct. And to see the beauty in that process. [Nora Bateson]
When you see process you see constant change. That's why Gregory was constantly quoting Heraclitus "no man can step into the same river twice". Because it's flowing. [Mary Bateson]
Only by the creation of change can I perceive something. [Gregory Bateson]
A man walking is never in balance, but always correcting for imbalance. [Gregory Bateson]
He asked the question "What is there about our way of perceiving that makes us not see the delicate interdependencies in an ecological system, that give it its integrity." We don't see them, and therefore we break them. [Mary Bateson]
Any kind of aesthetic response is a response to relationships. [Mary Bateson]
I hope it may have done something to set you free from thinking in material and logical terms, when you are, in fact, trying to think about living things. [Gregory Bateson]
management of the absurd
is an excellent book by Richard Farson,
subtitled Paradoxes in Leadership (isbn 0-684-83044-2).
As usual I'm going to quote from a few pages:
The more important a relationship, the less skill matters.
Any technique loses its power when it becomes evident that it is a technique.
People need to know they are dealing with a genuine person, not someone who is "managing" them.
It is only when the balance of power is relatively equal that truly candid communication can and should take place.
When we really listen, so that we understand the other person's perspective, we risk being changed ourselves.
Every management act in some way redistributes or reinforces power.
Ex-convicts are better able to rehabilitate prison inmates than is the prison staff. Ex-drug addicts are more successful in getting other addicts off drugs than are psychiatrists. Students learn more from each other than they do from their professors.
The introduction of highly participative systems tends to bring attacks on the stronger members, often the leaders, while more hierarchical systems bring attacks on the weaker members.
The way to judge your effectiveness is to assess the quality of the discontent you engender.
Scale is the enemy of creativity... Only prisons housing fewer than twenty inmates are likely to be rehabilitative.
The big change... held; the little ones have been much easier to resist.
We learn not from our failures but from our successes - and the failures of others.
By and large, organizations are simply not good at changing themselves. They change more often as a result of invasion from the outside or rebellion from the inside, less so as a result of planning.
Planning may not be effective at assessing the future, but it can be a good way to assess the present.
Strengths and weaknesses come dressed in the same clothing.
Children look at things we turn away from. Sometimes just pointing at what is going on is a valuable way to break through a barrier.
When people feel responsible for handling some situation in which they are, in fact, largely helpless, a dangerous combination of feelings is created: responsibility plus helplessness leads to abuse.
Training makes people more alike... Education... tends to make people different from each other.
the starfish and the spider
is an excellent book by Ori Brafman and Rod Beckstrom (isbn 1-59184-143-7).
As usual I'm going to quote from a few pages:
This is a book about what happens when there is no one in charge. It's about what happens when there's no hierarchy.
Instead of a chief, the Apaches had a Nant'an - a spiritual and cultural leader. The Nant'an led by example and held no coercive power. Tribe members followed the Nant'an because they wanted to, not because they had to... The phrase "you should" doesn't even exist in the Apache language.
Instead of having a head, like a spider, the starfish functions as a decentralized network. Get this: for the starfish to move, one of the arms must convince the other arms that it's a good idea to do so. The arm starts moving, and then - in a process that no one fully understands - the other arms cooperate and move as well. The brain doesn't "yea" or "nay" the decision. In truth, there isn't even a brain to declare a "yea" or "nay". The starfish doesn't have a brain. There is no central command.
Open systems can't rely on a police force. On the one hand there's freedom to do what you want, but on the other hand, you have added responsibility: because there are no police walking around maintaining law and order, everyone becomes a guardian of sorts.
To collect money, you generally need to have an accountant somewhere, which leads to centralization.
When you give people freedom, you get chaos, but you also get incredible creativity.
It is the right as well as the duty of every managerial employee to criticize a central management decision which he considers mistaken or ill-advised... such criticism is not only not penalized; it is encouraged as a sign of initiative and of an active interest in the business. It is always taken seriously and given real consideration. [Peter Drucker]
I taught them that communication is to be upward if it is to work at all... I taught them that top management is a function and a responsibility rather than a rank and a privilege. [Peter Drucker]
A typical GM factory in the 1980s... if an employee make a mistake or detected a problem, he could stop the line, whereupon a loud alarm would sound... The Toyota assembly line... if an employee stopped the line a pleasant "ding-dong" would sound and teams would carefully study what was going on.
It's better, as the saying goes, to be vaguely right than precisely wrong.
When we are used to seeing something in a certain way, it's hard to imagine it being any other way. If we're used to seeing the world through a centralized lens, decentralized organizations don't make much sense.
smart swarm
is an excellent book by Peter Miller (isbn 978-0-00-738297-2).
As usual I'm going to quote from a few pages:
As successful foragers return to the nest with seeds, they're met at the nest entrace by foragers waiting in reserve. This contact stimulates the inactive ants to go out. Foragers normally don't come back until they find something. So the faster the foragers return, the faster other ants go out, enabling the colony to tune its work force to the probability of finding food.
Instead of attempting to outsmart the desert environment, the ants, in a sense, were matching its complexity with their own.
Instead of trying to keep fine-tuning a system so it will work better and better, maybe what we really ought to be looking for is a rigourous way of saying, okay, that's good enough. [Deborah Gordon]
If a scout bee was impressed by another scout's dance, she might fly to the box being advertised and conduct her own inspection, which could last as long as an hour. But she would never blindly follow another scout's opinion by dancing for a site she hadn't visited.
J. Scott Turner considers the mound's function as a respiratory system so essential that the termites couldn't live without it. In a sense, he argues, the mound is almost a living part of the colony.
If individuals in a group are prompted to make small changes to a shared structure that inspires others to improve it even further, the structure becomes an active player in the creative process.
Unlike our systems, which are tuned for efficiency, the termites' systems have been tuned for robustness, which they demonstrate by building mounds that are constantly self-healing.
What really made the lights go on was the realization that termites don't pay attention to the environment itself but to changes in the environment.
Not only does this complicated structure represent an indirect collaboration among millions of individuals, it also embodies a kind of ongoing conversation between the colony and the world outside. The mound might look like a structure, but it's better thought of as a process.
We should think of it [the termite mound] as a dynamic system that balances forces both inside and outside its walls to create the right environment for the termites.
When you feel like you belong to something, it gives you so much more freedom and so much more energy that might otherwise be used up in anxiety, to do other things.
On January 12, 2006, several hundred thousand pilgrims had gathered in a dusty tent city at Mina, three miles east of Mecca...
By noon... about a half-million or more pilgrims filled the Jamarat plaza in front of the bridge... The pressure inside the crowd was crushing... More than an hour later, victims were piled up seven layers deep: 363 men and women were dead.
"Those in charge need to remember the root cause of the problem: too many people trying to get through too small a space. The ingress rate at the bridge was 135,000 per hour. The thoughput rate of the pillars was only 100,000 an hour. You can't put a pint into a half-pint jug." [Keith Still]
the power of pairing
|
|
|
In a previous post I talked about an example where a pair performed better than either individually. Here's another small example that happened to me today. |
odd(Integer) when Integer rem 2 == 1 ->
true;
odd(_) ->
false.
filter_test() ->
?assertEqual([3, 1],
filter(fun(Elem) -> odd(Elem) end, [1, 2, 3, 4])).
I don't know Erlang at all, so Syver helped me out with this first-cut version:
filter(_, []) ->
[];
filter(Fun, [Head|Tail]) ->
filter_helper(Fun(Head), Fun, Head, Tail, []).
filter_helper(true, Fun, TrueElement, [Head|Tail], Result) ->
filter_helper(Fun(Head), Fun, Head, Tail, [TrueElement|Result]);
filter_helper(true, _, TrueElement, [], Result) ->
[TrueElement|Result];
filter_helper(false, Fun, _, [Head|Tail], Result) ->
filter_helper(Fun(Head), Fun, Head, Tail, Result);
filter_helper(false, _, _, [], Result) ->
Result
I realized Erlang is a lot like Prolog which I knew in the dim and distant past.
I stared at the code and after several minutes something about it started nagging me.
It was the splitting of the list into it's Head and Tail elements in both filter and filter_helper.
I wondered if this duplication could be avoided by making filter_helper call back into filter.
After several false attempts I came up with:
filter(_, []) ->
[];
filter(Fun, [Head|Tail]) ->
filter_helper(Fun(Head), Fun, Head, Tail).
filter_helper(true, Fun, TrueElement, List) ->
X = filter(Fun,List),
[TrueElement|X];
filter_helper(false, Fun, _FalseElement, List) ->
filter(Fun, List).
Then Syver showed me how the use of X could be collapsed:
filter(_, []) ->
[];
filter(Fun, [Head|Tail]) ->
filter_helper(Fun(Head), Fun, Head, Tail).
filter_helper(true, Fun, TrueElement, List) ->
[TrueElement|filter(Fun, List)];
filter_helper(false, Fun, _FalseElement, List) ->
filter(Fun, List).
We did some argument renaming:
filter(_, []) ->
[];
filter(Fun, [Head|Tail]) ->
filter_helper(Fun(Head), Fun, Head, Tail).
filter_helper(true, Fun, Head, List) ->
[Head|filter(Fun, List)];
filter_helper(false, Fun, _, List) ->
filter(Fun, List).
Then Syver noticed that we could pass Head,Tail as a single [Head|Tail] argument:
filter(_, []) ->
[];
filter(Fun, [Head|Tail]) ->
filter_helper(Fun(Head), Fun, [Head|Tail]).
filter_helper(true, Fun, [Head|Tail]) ->
[Head|filter(Fun, [Head|Tail])];
filter_helper(false, Fun, [_|Tail]) ->
filter(Fun, Tail).
We agreed that filter_helper was better as filter:
filter(_, []) ->
[];
filter(Fun, [Head|Tail]) ->
filter(Fun(Head), Fun, [Head|Tail]).
filter(true, Fun, [Head|Tail]) ->
[Head|filter(Fun, [Head|Tail])];
filter(false, Fun, [_|Tail]) ->
filter(Fun, Tail).
As a final polish Syver refactored to this:
filter(_, []) ->
[];
filter(Fun, [Head|Tail] = List) ->
filter(Fun(Head), Fun, List).
filter(true, Fun, [Head|Tail]) ->
[Head|filter(Fun, [Head|Tail])];
filter(false, Fun, [_|Tail]) ->
filter(Fun, Tail).
and then, again, after the dojo, thanks to Syver's comment below, to this:
filter(_, []) ->
[];
filter(Fun, [Head|_] = List) ->
filter(Fun(Head), Fun, List).
filter(true, Fun, [Head|Tail]) ->
[Head|filter(Fun, [Head|Tail])];
filter(false, Fun, [_|Tail]) ->
filter(Fun, Tail).
We agreed that the final version was definitely better than either of us could have come up with individually.
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,
Dancing with elves
subtitled Parenting as a Perfoming Art,
is an excellent book by John Gall (isbn 978-0-9618251-4-0). As usual I'm going to quote from a few pages:
No one can avoid influencing others. The only question is whether we are going to do it knowingly or unknowingly. Our position is that knowledge is better than ignorance.
Command-and-control tries to get 100% compliance - an impossible goal. In the name of discipline, it teaches rigidity.
The mother bird repeats the sequence over and over, with endless patience, until the children learn. You never see a mother bird attack her offspring; you never see her punish her baby for failure to learn the lesson. When the adult animal teaches their offspring, it is done by one method and that is by modelling over and over the desired behaviour.
Talking about your own experiences causes others to access their own similar experiences. I wish I could get across to you how powerful this effect is and how silently it operates.
Words have this incredible power to call up experience.
What a momentous thing you are doing when you speak words to your child or to your spouse or to any other person. You have the power to create their experience, you have the power to shape it, to make it beautiful. You can give them the experience of competence, of comfort, of success.
Somewhere between the first week of life and age forty or fifty, something rather serious happens. We stop using our feedback. We're carefully taught to pay attention to the program inside our head, instead of what's happening in the real world.
When you speak to someone, they split into two pieces. This happens all the time, to everybody. There's a part that wants to go along with what you say, and then there's a part that wants to defend their individuality, they're not going along. There's the part that agrees, and a part that disagrees, simultaneously.
It obviously doesn't make sense to demand impulse control from a little person that doesn't have it.
If you see "stubbornness" then you're naturally going to expect certain things. You're going to act in certain ways, you're going to get an interaction started that assumes this.
What does it mean when you say a person is "just lazy?" or "just stubborn?". It really means that you have tried out some of your repertoire of behavioural interventions in order to elicit a desired piece of behaviour from the other person and you have failed, because your repertoire was too limited.
hunger is the best source
I've previously blogged about being taught ITA spelling at primary school. About how it causes me spelling problems. I was reminded of this when speaking to Geir Amdal at the excellent Agile Coach Camp in Oslo.
Geir showed me this wonderful blog post with lovely twist on the famous quote:
Knowledge is power.
Francis Bacon
It reminded me of something my Mum used to say to me when I was little:
Hunger is the best source.
For many many years I didn't understand what she was saying. I was seeing the word sauce as source. She was actually saying:
Hunger is the best sauce.
Food tastes better when you're hungry. Reflecting on my confusion I realize I'm actually quite proud of this mistake. This was a long time ago remember. I was a small boy at the time. Even then, it seems, software was calling me.
Quality Software Management
Vol 2. First-Order Measurement
is the title of an excellent book by Jerry Weinberg (isbn 0-932633-24-2). This is the second snippet review for this book
(here's the first).
As usual I'm going to quote from a few pages:
The update cycle on the project control panel should be scaled to something less than the longest period of time the project can afford to be late.
Large projects always fail when their communication systems fail.
The slowdown of fault removal is a major reason why project times are underestimated.
In the end, it's not the observation that counts, it's the response to the observation. That's why Zen masters teach patience in response.
Culture makes its presence known through patterns that persist over time.
What power corrupts most thoroughly is the ability to make meaning of observations.
Incongruent behaviour is the number one enemy of quality, because it disguises what people truly value.
If you can see it you can review it.
The switch from cost observation to value observation is the strongest indication that an organization has made the transition from Pattern 2 [Routine] to Pattern 3 [Steering].
In my consulting, I frequently talk to managers who seem obsessed with cutting the cost of software or reducing development time, but I seldom find a manager obsessed with improving value.
No other observational skill may be more important to software engineering than precision listening.
Agile A-Z Keynote
I attended the excellent Agile .NET 2011 conference in Ghent, Belgium this week. Jason Gorman pulled out at the last minute and Erik asked me if I'd step in and do the keynote. I said yes of course and prepared this on the train+plane there.
An Agile A to Z
View more presentations from JonJagger.
Precision Listening
At the ALE conference I did a lightning talk. On my first slide I quoted this from Jerry Weinberg's
Quality Software Management Volume 1: Systems Thinking:
As consultants, we've found that the quickest and surest way to classify organizations into similar patterns is by the way people think and communicate.
On the second slide I quoted Jerry again (from the same book):
No other observation skill may be more important to software engineering than precision listening.
I was reminded of this a moment ago when someone cold-called me. I honestly don't remember what the person's name was or what they were selling. What I do remember is how the conversation started:
Hello, Jon Jagger speaking.
Hello, can I speak to Jon Jagger please.
Do you recognise this pattern? This response is pure waste. It does nothing but waste my time. After this response the one thing I know for sure is that they're not listening to me. And if they're not listening to me why should I listen to them?
In the brain of me
Here's a video of the SkillsMatter talk I did on Thursday, titled "Stuff I'm starting to know now that I really wish I'd known 20 years ago".
Its loosely based on the theme of Making The Invisible More Visible, one of my entries from the book, 97 Things Every Programmer Should Know. I completely botched what I was trying to say about courage. What I was trying to say was that courage is not the absence of fear.
My other SkillsMatter talk was based on Do More Deliberate Practice my other entry in the 97 Things Book.
This was the first run of quite a lot of new material so I was quite nervous, but I felt most of it went very well. Here's some of the feedback.
- Fun, informative, useful
- An interesting brain dump
- Entertaining and enlightening
- Very good. Thoughtful and interesting
- Great content - very interesting
- Great laid back presentation
- Interesting ideas and great presentation to go with it
- Well planned presentation, not just your standard powerpoint
- Very good talk. Inspiring
- Very interactive and well explained
- Clear explanations, good analogies, funny
- Fantastic
- Very good. Passionate speaker. Good insights
On becoming a person
is an excellent book by Carl Rogers (isbn 978-1-84529-057-3). As usual I'm going to quote from a few pages:
The first stage… There is an unwillingness to communicate self. Communication is only about externals… He is structure-bound in his manner of experiencing. That is, he reacts "to the situation of now by finding it to be like a past experience and then reacting to that past, feeling it".
The concept of "cure" is entirely inappropriate, since in most of these disorders we are dealing with learned behaviour, not with a disease.
Thus scientific methodology is seen for what it truly is - a way of preventing me from deceiving myself...
It is a type of learning which cannot be taught. The essence of it is the aspect of self-discovery.
Involved in this process of becoming himself is a profound experience of personal choice. He realises that he can choose to continue to hide behind a facade, or that he can take the risks involved in being himself.
He is more open to his feelings of fear and discouragement and pain. He is more open to his feelings of courage and tenderness, and awe.
Such living in the moment mean an absence of rigidity, of tight organisation, of the imposition of structure on experience. It means instead a maximum of adaptability, a discovery of structure in experience, a flowing, changing organisation of self and personality.
The good life is a process, not a state of being. It is a direction, not a destination.
He has changed, but what seems most significant, he has become an integrated process of changingness.
The process involves a shift from incongruence to congruence.
The incongruence between experience and awareness is vividly experienced as it disappears into congruence.
The psychology of computer programming
is an excellent book by Jerry Weinberg.
As usual I'm going to quote from a few pages:
I know I've snippeted this before, but I've read it again and I don't see why a really good book shouldn't get repeat snippets. It was published in 1971. If there's an earlier software-related book still in print I don't know what it is.
We must deal with one other problem, which is important because of a seldom questioned view of programming - a view which this book will spend a great deal of time questioning. That view is that programming is an individual activity.
In the end though, it's their method of learning that distinguishes teams from groups… team members always have a common goal, regardless of the product - the goal of helping each other learn to perform better.
If egoless programming is used, everyone in the group will have the opportunity to examine the work of everyone else at some time, thereby tending to prevent the establishment of strong hierarchy.
The greatest challenge, then, is not creative thinking, but creative communicating: representing our thoughts in a way that other persons - each with a unique style - can understand.
The programming business relies more than any other on unending learning.
Subscribe to:
Posts (Atom)
















