- the setup start-points are now decoupled from the server and can be customized.
- the manifest.json format has changed accordingly.
- the instructions for running your own cyber-dojo server are new.
Hi. I'm Jon Jagger, director of software at Kosli.
I built cyber-dojo, the place teams practice programming.
It started out as a joke between myself and Josh (one of the testers at Bluefruit). I had the traffic lights in my office as I was preparing a stand to promote the outreach events (Summer Huddle, Mission to Mars, etc...) Software Cornwall runs. The conversation went on to alternative uses for the traffic lights, I was planning to see if people would pay attention to the traffic lights if I put them in a corridor at the event; we then came up with the idea that we could use them to indicate TDD test status.
Although it started out as a joke I am going to use it at the Summer Huddle, the lights change every time anyone runs a test so it should give an idea of how the entire group are doing without highlighting an individual pair.
The software setup is very simple, there is a Python web server (using the Flask library) running on a Raspberry Pi that controls the traffic lights using GPIO Zero. When the appendTestTrafficLight() function (in run_tests.js.erb) appends the traffic light image to the webpage I made it send an http 'get' request to the Raspberry Pi web server to set the physical traffic lights at the same time. At the moment the IP address of the Raspberry Pi is hard coded in the 'run_tests.js.erb' file so I have to rebuild the web image if anything changes but it was only meant to be a joke/proof of concept. The code is on a branch called traffic_lights on my fork of the cyber-dojo web repository.
The hardware is also relatively simple, there is a converter board on the Pi; this only converts the IO pin output connector of the Raspberry Pi to the cable that attaches to the traffic lights.
The other end of the cable from the converter board attaches to the board in the top left of the inside the traffic lights; this has some optoisolators that drive the relays in the top right which in turn switch on and off the transformers (the red thing in the bottom left) that drive the lights.
I have to give credit to Steve Amor for building the hardware for the traffic lights. They are usually used during events we run to teach coding to children (and sometimes adults). The converter board has LEDs, switches and buzzers on it to show that there isn't a difference between writing software to toggle LEDs vs driving actual real world systems, it's just what's attached to the pin. Having something where they can run the same code to drive LEDs and drive real traffic lights helps to emphasise this point.
I was reading one of Michael Feathers excellent blog posts on Symbiosis. His writing really resonates with me. As I get older I feel I'm starting to get a handle on thinking about things more dynamically and less statically. Looking back, if I had to pick the one thing that helped me the most on this road I would say its Le Chatelier's Principle, which I paraphrase as
Stable systems tend to oppose their own proper function.As I recall, Le Chatelier was a chemist and his principle is worded in the context of chemical reactions. The same fundamental "system of opposition" is also described in Walter B. Cannon's classic book The Wisdom of The Body which I first learned about in Jerry Weinberg's book General Principles of Systems Design (p 177). I'd like to try to explain what "oppose their own proper function" means using an example from the body. It's called the Glucose Cycle.
If you eat a donut your blood sugar (glucose) increases...
If this increase continues unchecked you get hyper-glycemia and you die very quickly.
Fortunately this does not happen because the mammalian body is the result of millions of years of destructive testing!
Cells in the pancreas detect the glucose increasing and start producing insulin.
The liver and muscles detect the insulin increasing and start converting glucose into a stored form (called glycogen).
This naturally reduces the amount of glucose and you don't get hyperglycemia.
However...
If this decrease continues unchecked you get hypo-glycemia and you die very quickly.
Fortunately this does not happen either because other cells in the pancreas detect the glucose decreasing and start producing glucagon.
The liver and muscles detect the glucagon increasing and start converting the glycogen back to glucose.
These two effects work in opposition to each other regulating the blood stream glucose.
All this tremendous activity to keep something else constant.
I find it deeply beautiful and deeply paradoxical.
Bradford Keeney writes about this same paradox in his classic book The Aesthetics of Change.
An example he uses is evolution. He writes about the battle between a predator and its prey goes beyond
the 'mere' battle for food and territory. He describes a larger cybernetic picture, how the ongoing battle
is itself a means or process of generating, maintaining, and stablizing an ecosystem.
That evolution is always co-evolution as John Gall said.
This duality suggests that if you want to understand how codebases successfully change you should also understand
how codebases successfully stay the same. To quote The Aesthetics of Change again: "Change cannot be found without a roof of stability over its head. Similarly stability will always be rooted to underlying processes of change".
In this light I see test driven development, as much more than simply specifying required behaviour (as important as that is).
I see coding and testing working in opposition to each other naturally regulating each other.
The ongoing 'battle' between coding and testing, between change and constancy, is itself a primary means of generating, maintaining, and stabilizing the development process.
All simple and complex regulation as well as learning involve feedback. Contexts of learning and change are therefore principally concerned with altering or establishing feedback.
Complex systems can evolve from simple systems only if there are stable intermediate forms.
A complex system that works is invariably found to have evolved from a simple system that worked.
In the modern era, we have come to favor simplicity over complexity, perfection over imperfection, symmetry over asymmetry, planning over piecemeal growth, and design awards over habitability. Yet if we look at the art we love and the music, the buildings, towns, and houses, the ones we like have the quality without a name, not the deathlike morphology of clean design.
A central and hard-earned engineering principle in older engineering areas such as mechanical engineering and civil engineering is that simplicity rules.
Keeping things simple is an art. And, as with any art, simplicity needs to be cultivated.
I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies. [C.A.R. Hoare]
The art of leadership is an art based on simplicity, and all success is rooted in performance.
Simplicity supports courage because you can afford to be much more courageous with a simple system.
Simplicity in conduct, in beliefs, and in environment brings an individual very close to the truth of reality.
An expert is someone who has succeeded in making decisions and judgements simpler through knowing what to pay attention to and what to ignore. Simplicity means focused effort. Simplicity is a unification around a purpose.
Simple organization is about what feels good as you're using the software, not what looks logical in a plan.
is the title of an excellent book by Fredrik Backman.
As usual I'm going to quote from a few pages:
He felt one should not go through life as if everything was exchangeable. As if loyalty was worthless. Nowadays people changed their stuff so often that any expertise in how to make things last was becoming superfluous. Quality: no one cared about that any more. Not Rune or the other neighbours and not those managers in the place where Ove worked. Now everything had to be computerised, as if one couldn't build a house until some consultant in a too-small shirt figured out how to open a laptop.
'They've bumped up the electricity prices again,' he informs her as he gets to his feet. He looks at her for a long time. Finally he puts his hand carefully on the big boulder and caresses it tenderly from side to side, as if touching her cheek. 'I miss you,' he whispers. It's been six months since she died. But Ove still inspects the whole house twice a day to feel the radiators and check that she hasn't sneakily turned up the heating.
'Now you listen to me,' says Ove calmly while he carefully closes the door. 'You've given birth to two children and quite soon you'll be squeezing out a third. You've come here from a land far away and most likely you fled war or persecution and all sorts of other nonsense. You've learned a new language and got yourself an education and you're holding together a family of obvious incompetents. And I'll be damned if I've seen you afraid of a single bloody thing in this world before now.' ...
'I'm not asking for brain surgery. I'm asking you to drive a car. It's got an accelerator, a brake, a clutch. Some of the greatest twits in world history have sorted out how it works. And you will as well.'
And then he utters seven words, which Parvaneh will always remember as the loveliest compliment he'll ever give her.
'Because you are not a complete twit.'
Men like Ove and Rune were from a generation in which one was what one did, not what one talked about.
Ove has probably known all along what he has to do, but all people are time optimists. We always think there's enough time to do things with other people. Time to say things to them. And then something happens and then we stand there holding on to words like 'if'.
'But serious, man. You do this every morning?' Jimmy asks cheerfully.
'Yes, to check if there have been any burglaries.'
'For real? Are there a lot of burglaries round here?'
'There are never a lot of burglaries before the first burglary,' Ove mutters and heads off towards the guest parking.
'There is no hope for these boys and girls,' the headmaster soberly explained in the interview. 'This is not education, this is storage.' Maybe Sonja understood how it felt to be described as such. The vacant position only attracted one applicant, and she got the boys and girls to read Shakespeare.
I'm salmon fishing on the River Spey, on the beautiful Tulchan beat,
concentrating on spey casting.
My phone is back at the hotel.
My laptop is back at the hotel.
I'm not thinking about coding.
I'm fishing and I'm only fishing.
Suddenly, from "nowhere" my subconcious pops an idea up into my consciousness.
It says, hey, you know that code you were working on 2 weeks ago...?
Where you had that nagging feeling there was a better, simpler solution?
I know you know what I'm talking about!
We'll I've been working on that for you.
And I've come up with this. Here's the idea. Tada. What do you think?
For a moment, I think about the idea. It seems a good one.
Of course, I can't try it out now because I'm
waist deep in the middle of the River Spey. I promise myself I'll look
into it when I get back to the hotel.
I carry on trying to catch a salmon.
Later, back at the hotel I try out the new idea. I re-run all the unit
tests and they pass. I make the change.
A few weeks later I'm fishing again. This time on the River Tay at Dunkeld. My subconscious pops up a new idea. I make a note of it. In the evening, back at the hotel I try the change. All the tests pass. The change is live.
A few weeks later I'm fishing again. On the River Verdal in Norway. My subconscious pops up with another new idea...
I'm salmon fishing on the River Spey, on the beautiful Tulchan beat,
concentrating on spey casting.
My phone is back at the hotel.
My laptop is back at the hotel.
I'm not thinking about coding.
I'm fishing and I'm only fishing.
Suddenly, from "nowhere" my subconcious pops an idea up into my consciousness.
It says, hey, you know that code you were working on 2 weeks ago...?
Where you had that nagging feeling there was a better, simpler solution?
I know you know what I'm talking about!
We'll I've been working on that for you.
And I've come up with this. Here's the idea. Tada. What do you think?
For a moment, I think about the idea. It seems a good one.
Of course, I can't try it out now because I'm
waist deep in the middle of the River Spey. I promise myself I'll look
into it when I get back to the hotel.
I carry on trying to catch a salmon.
Later, back at the hotel I think about the new idea.
I'm wary of making the change.
There are no unit-tests I can quickly run.
I'm remembering a few months back - that time when I tried an idea and broke
stuff and was castigated.
I'm fearful of making the change. I don't make it.
A few weeks later I'm fishing again. This time on the River Tay at Dunkeld. My subconscious gives me a new idea. I make a note of it. In the evening, back at the hotel I think about making the change. There are still no unit-tests. And I'm still remembering that time a few months back - when I tried an idea and broke stuff. Boy was I ridiculed. And if anything the culture is a bit worse since then. I can feel the fear. Once again I decide not to make the change.
A few weeks later I'm fishing again. On the River Verdal in Norway. This time, my subconscious doesn't pop up a new idea.
It's hard to pick just one reason why I love the accu conference. There are lots of reasons. I'll try to pick something perhaps a bit different. I love the accu conference because of its culture. Let me give you an example.
At most software conferences around the world the speakers are treated specially. For example, speakers get access to a separate area where they can work in private. Not at the accu conference! At the accu conference we don't provide a special speakers lounge. We want everyone to mingle together, speakers most definitely included.
At most software conferences around the world the speakers are treated specially. For example, speakers get a special lanyard in a different colour. Not at the accu conference! At the accu conference speakers don't get a special lanyard. We want everyone to mingle together, speakers most definitely included.
The most important feature of the idealized object machine is its store, which consists of a set of numbered storage cells arranged so that the numbers labelling adjacent cells differ by one. All storage cells are the same size (a constant of the implementation, which is usually between 16 and 36 bits).
The readability of a program largely depends on the skill and style of the programmer; however his task is simplified if he is using a language with a rich set of expressive but concise constructions.
The philosophy of BCPL is not one of the tyrant who thinks he knows best and lays down the law on what is and what is not allowed; rather BCPL acts more as a servant offering his services to the best of his ability without complaint, even when confronted with apparent nonsense. The programmer is always assumed to know what he is doing and is not hemmed in by petty restrictions.
A procedure is invoked by writing its name, followed by the list of arguments in brackets. There is no call statement as in Fortran or PL/I.
The section brackets $( and $) enclose the statements of a procedure, and are, in many respects, like begin and end in Algol.
As a matter of style, they [spaces] should be used frequently to enhance readability.
Comments are introduced by the character pair //.
The BCPL input/output system is based on the idea of a stream. A BCPL stream should be regarded as a sequence of characters.
One of the most useful features of BCPL is that one form of command is a set of statements enclosed in a $( $) pair. As a general rule in BCPL, anywhere you can write a simple command, you can use a compound command or a block. The set of statements enclosed in $( $) is called a compound command unless the statements starts with declarations, in which case the whole thing is called a block.
BCPL has been carefully designed so that function and routine calls bring little overhead.
You know know enough to write quite substantial programs, and it would be a good idea if you paused long enough to do so.