the true power of pair programming

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

the true power of pair programming

Stéphane Ducasse
Hi guys

I wanted to share that with you. Today I wanted to do something than administration or duties for my job.
So we sat with igor and pair programmed. We took a bad part of the system….
HandMorph>>processEvents and HandMorph>>generateMouseEvent:

and we started. It was the kind of adventure that alone looks like a dark and humid tunnel….boring painful and tedious.
Now we started and banged our heads against it and little micro steps by little micro steps we continued…
The beginning was muddy and crashing.
At the end we can generate MorphicMouseEvent using nicely created systemEvent (instead of the ugly third, fourth, sixth and second of course… ugly eventBuffer code),
we started to have double dispatch instead of these terrible case statements.
From time to times we felt discouraged (you know the kind of state of mind - where you think that nothing will happen and that the system
is so old and circumvolved and that your dreams will not come true).
But slowly eating cookies and discussing design, sharing the keyboard abstractions and good code emerged and this was just great.
This is not finished and we will continue.
But this was cool. Two guys chatting and eating cookies do not feel the darkness of the tunnel and can lit some fire to see further down.

Stef

Gofer
        squeaksource: 'EventModel'
        package: 'EventModel';
        load

Look at EventModel-System and
        SystemInputEvent hierarchy
        and the handle* methods in *EventModel of HandMorph.

The adventurous can even try :)

| ann evt |
ann := SystemInputEventAnnouncer new.
ann subscribe: SystemInputEvent send: #dispatchEvent: to: World activeHand.
 
10 timesRepeat: [
        500 milliSeconds asDelay wait.
        evt := Sensor nextEvent.
        evt ifNotNil: [
                ann handleEvent: evt
        ].
]