Hi. I'm Jon Jagger.
I help software teams improve their effectiveness.
I built cyber-dojo, the place teams practice programming.
I'm based in the UK.
I've worked in 22 countries.
If you don't like my work, I won't invoice you.
Hire me

Pages

Are all magic numbers bad? To give the classic consultants answer - it depends.
Take zero for example. If the zero is being used as an index into an array then the zero is a zero because all arrays start at zero. That's internal knowledge; knowledge that is part of the solution and a reflection of something from the problem. There is no way you can conceive of a change in the problem causing a change to that zero. So it's internal. So it's ok. But all things are relative. It might still be a good idea to refactor - to a higher level expression of the iteration perhaps. But most numbers are not internal, they come from the problem. If numbers such as this are not named then they are indeed magic numbers; they are numbers that reveal nothing of their origin.

Magic isn't limited to numbers though. Far from it. A magic number is a number and a number is an expression. So a magic number is also a magic expression. And of course, all expressions lie on the same magic-code continuum; some expressions are very intention-revealing, they're not very magic at all - while other expressions are very cryptic and thus qualify as magic expressions regardless of whether they contain numbers or not.

Beyond magic expressions we have magic statements, magic functions, magic classes, you name it, if its part of the code it can be magic. I think it's time we pushed the word magic into greater service. It's time we had a better vocabulary for hard to understand things. If you see a hard-to-understand X in code how about calling it a magic X.

When I'm training/coaching a group of people I often haven't met any of them before and sometimes they haven't met each other either. So one of the first things we all have to do is get to know each others names. It can be boring and painful asking each person to briefly introduce themselves so here's an alternative...

Instead, announce that you want everyone to write their name on a flipchart (or whiteboard) and that you're going to time how long it takes. Your mobile phone probably has stopwatch feature (if not just count out loud). Then just say "go" and start the stopwatch. Some people will be puzzled and just sit there doing nothing for a while, but eventually everyone will realize you really mean it! When they've finished and sat down again tell them how long it took, comment on the illegibility of their writing, prepare a new sheet of paper on the flipchart (or wipe the whiteboard), and ask them to do it again making it clear that this time you want it done faster. And legibly! You have to be able to read the names! Say "go" again and restart the stopwatch.

You can easily and quickly repeat this up to ten times. You can allow a little retrospective time between iterations if you like. You can insist that the names are drawn in a way that bears some relation to where they're actually sitting. The variations are endless. The ingenuity shown by the groups when I've run this is often remarkable. They easily get the time down from about 2 minutes to a few seconds. I've also found it works very well if you rerun the exercise every morning (perhaps after hiding most of the pens ;-)

Quite by chance I've learned that my friend Henrik Kniberg has been using peoples names as the theme for a
similar group exercise.

Whiteboards are a great UML case tool. They help to make modelling a social activity. They help to emphasize that the act of modelling and the understanding it produces is just as valuable as the resulting model.
The wipeability of whiteboards is also a great feature. It encourages modification and experimentation.

Whiteboards are not so good when you want to rearranging a diagram though. But... it occurred to me that if the whiteboard is magnetic then fridge-magnet-style UML-shapes might help. So I found a company that sells magnetic sheet and paid a bit extra to have it coated with a dry-wipe surface. The first sample arrived today and I've made my first prototypes. I cut out two sizes of rectangles and edged them with a permanent marker. Here's one of the larger ones (the background is a tablecloth not wallpaper!)

Now simply stick them on the whiteboard - they stick to each other of course:

Here's the big rectangles vertically in 3-section class format:

And horizontally for packages (just draw on the top-left tab):

Here's a 1-section only class diagram overview made from the smaller rectangles:

And just for Pete Goodliffe here's a Booch cloud:

I'm also going to cut out some ellipses for use-cases/scenarios and some rounded rectangles (roundtangles) for activities/states.

A C file has its #includes and these #includes will have their own #includes, ad infinitum. It can be tricky knowing whether a type has already been typedef'd or not, and hence whether the C file has to declare its own typedef or not (for example, when forward declaring the type). However, there is a style that neatly avoids this problem

This is somewhat similar to the C++ rule that header files always use explicit :: qualification.
My friend Kevlin Henney commented that the idea is also resembles using typedef's in the private section of a C++ class which is a nice observation.
I haven't tried this on a large codebase. At the moment it's just an idea. Caveat emptor.

UML Use Case/Scenario ellipses look quite similar to cartoon speech bubbles. And each ellipse is of course supposed to be "spoken" by an actor. So sometimes when I'm coaching/training/etc I cut out ellipse shaped pieces of card and do some role playing.

You can have fun too. For example, developers often phrase their use-cases from the implementation perspective rather than from the actor's perspective. So when they write "Lend a Book" as the name of their Use Case, you can get them to actually try it. Pretend your inside a library, give them a book, and ask them to role play their use case. Like this... (the headband stops their arms from aching)

At which point someone role playing a Librarian can react like this...

Most organizations are terrible at applying the principles of great performance. Many companies seem arranged almost perfectly to prevent people from taking advantage of these principles for themselves.

nothing, it turned out, enabled any group to reach any given grade without putting in those hours. ... There is absolutely no evidence of a 'fast track' for high achievers.

memory ability is very clearly created rather than innate.

General Electric CEO Jeff Immelt has been clear about what the company is looking for: someone who is externally focused, is a clear thinker, has imagination, is an inclusive leader, and is a confident expert.

The roadblocks we face seem to be mostly imaginary.

Jerry Rice was the greatest because he worked harder in practice and in the off-season that anyone else; he spent very little time playing football; he designed his practice to work on his specific needs; he did much of the work on his own; it wasn't fun; he defied the conventional limits of age.

Practice is so hard that doing a lot of it requires people to arrange their lives in particular ways.

Deliberate practice requires that one identify certain sharply defined elements of performance that need to be improved, and then work intently on them.

Practicing without feedback is like bowling through a curtain that hangs down to knee level. You can work on technique all you like, but if you can't see the effects, two things will happen: You won't get any better, and you'll stop caring.

Feedback? At most companies this is a travesty, consisting of an annual performance review dreaded by the person delivering it and the one receiving it. Even if it's well done, it cannot be effective. Telling someone what he did well or poorly on a task he completed eleven months ago is just not helpful.

Great performers never allows themselves to reach the automatic, arrested-development stage in their chosen fields. The essence of practice, which is constantly trying to do the things one cannot do comfortably, makes automatic behavior impossible.

In fact what they [great performers] have achieved is the ability to avoid doing it automatically.

A technique I use a lot when teaching/coaching is to get the participants to periodically do a summary. I have two main techniques:

The first technique (which I tend to use for smaller groups) is to ask the group to just shout out anything they can remember. Whatever they call out I write on a whiteboard and we briefly recap that topic. When the calling out slows down we stop. Then we vote; each person places three ticks on the whiteboard. I count up the ticks and we see what the top three are.

For a larger group I ask for just one thing from each person. I make it completely clear that you can choose anything you like for whatever reason you like. When someone calls something out I briefly summarize that topic but I don't write anything down.

In both cases I've found it's important not to simply ask each person, round-robin fashion, based on where they're sitting. It's much much better if you simply wait for the first person to speak, and then wait for the second person to speak, etc. That way the more confident ones naturally speak first and the less confident ones gain confidence by seeing the more confident ones go first.

My good friend Olve Maudal of Tandberg did a talk about Product Development in TANDBERG for the Oslo Lean Meetup. His slides are online at
http://bit.ly/cxNvjc
and are well worth a look if you care about what it takes to make world class software.

Reading up on how learning works, I came across a couple of quotes on the subject. I particularly like the one about the vaccination approach to knowing - it exposes our fantasy that all it takes is to “send people back to school”, and then everything will be fine.

Explaining the metaphor Tobias quotes Kurt Lewin:

The learners become their own subjects and no longer objects to be filled with packages of knowledge in the manner of what Neil Postman and Charles Weingartner call the vaccination approach to knowing - “where education is something you take and, when you have taken it, you’ve had it, and if you’ve had it you are immune and need not take it again.”

As a self-employed software coach-consultant-trainer-developer-enthusiast-etc I have to try and market myself. My marketing strategy is simple - I try to do stuff to increase my Google ranking. That's it. I monitor this by regularly typing my name into Google and seeing how many hits it generates. It's been around half a million for quite a while. I don't know why, but this morning it's suddenly jumped to over 2 million!

I'll be running Skills Matter's Agile Development in C# 3 day training course (starting March 3rd) in London. The course material is written by Kevlin Henney and is excellent. I'm really looking forward to it. Feel free to email me if you're thinking of attending.

Ellie's bike had a puncture today. I used some tyre-levers to prise the tyre off its wheel rim. Then I carefully pulled the inner tube out and was puzzled to see a large section had folded over on top of itself! How did that happen? A hurried previous repair? I attached a pump to the valve and pumped some air into the inner tube. Then I filled a bowl of water and plunged the inner tube into the water, shifting it along section by section. Suddenly a tell-tale stream of air bubbles revealed the source of an invisible hole in the inner tube. Right in the middle of an existing patch. More evidence of a hurried previous repair. I was struck by a few thoughts

The first is that air, like software, is invisible. To get the hole to reveal itself I switched to a different medium, from air to water.

The second is the importance of root cause analysis. Find the thorn and remove it. Otherwise you'll end up patching the patch just as I did.

In spite of appearances, good decision-making is essentially the same in all walks of life.

A belief that life was not merely best understood, but also best experienced, as a struggle.

You do not own a dog and bark.

Statistics are a wonderful servant and an appalling master.

The Cult of the (so-called) Expert would severely damage the great tradition of 'generalist', 'hands-on' management.

No greater damage could be done to our economy or to our society than to attempt to 'professionalize' management by 'licensing' managers, for example, or by limiting access to management to people with a special academic degree [Peter Drucker, 1954].

I absolutely loathe the idea of professional management [Jeff Immelt, 2004].

is the title of an excellent book by Dan Pink. As usual I'm going to quote from a few pages:

At the Yale School of Medicine, students are honing their powers of observation at the Yale Center for British Art, because students who study paintings excel at noticing subtle details about a patient's condition.

The MFA is becoming the new MBA.

Stories are how we remember.

One of the best ways to understand and develop the aptitude of Symphony is to learn how to draw.

The most creative among us see relationships the rest of us never notice.

Have you ever been in a washroom and failed to get any water out of a tap? Of course you have. We all have. It happens to me all the damned time.

The taps I hate the most are those stupid infra-red taps. The ones that are supposed to burst into life when you waggle your hands under them. Waggle to the left, waggle to right, in-out, in-out, doing the hokey-kokey. Your occasional random reward, if you're very lucky, is a short dribble of water.

The infra-redness is a ruse - it's fake - the tap is really part of sophisticated psychology experiment. Out of sight a white-coated clipboard-clutching technician is carefully monitoring your rising frustration. A favourite ploy is withholding water once you've dobbed a large blob of soap into your hands. And then watching as you fruitlessly search for a paper towel to wipe away the soap.

Another favourite is doctoring a clearly-full soap-dispenser into a soap-refuser. And of course, setting the force of the air-blower hand-drier to either barely-enough-to-fog-a-mirror or enough-to-lift-a-twelve-stone-man-clean-off-the-ground but never anything in between.