Refactoring of the Year?

Andreas Raab andreas.raab at gmx.de
Wed Feb 21 09:59:38 UTC 2007


Hi Guys -

I'm just in a writing mood today so I thought I'd share a short story. 
Most of you are probably aware how I have been bitching and moaning 
about "random refactorings" that move things from one corner of the 
system to the other, rename them incompatibly in the meantime and just 
generally leave more cruft and problems than they solve?

Well, I just had a completely opposite experience that shows Refactoring 
Done Right. The short version is: We had some serious problems at Qwaq 
with SocketStream in Croquet (which is a 3.8 variant) that has a variety 
of problems in it (our main problem was the lock-up you get in next: if 
a particular sequence of steps occurs). I was finally able to track this 
down to SocketStream and was ready to start a discussion on Squeak-dev 
when I -just to confirm it- tried it in 3.9 and noticed that it worked 
just fine there and that 3.9 has the FastSocketStream version instead of 
the 3.8 version.

So ... okay I thought this is going to break a number of things since 
really, it's a complete reimplementation so what can you expect. But I 
was willing to debug it and fix the remaining problems because 
SocketStream had proven to be simply to unreliable. Filed in 
SocketStream, immediately ran into two problems (missing methods in 
Socket that it required) added those.

And that was it. I didn't change another line of code other than these 
(basically internal) changes. It just worked. It has the same interface, 
it works the same. Only better. Faster. More reliable.

Suffice it to say, I was impressed. I had gotten so used to the 
assumption that a new version of a class (as well as Squeak) is so 
fundamentally incompatible with previous versions that I stopped porting 
stuff when we reached 3.9. SocketStream was the nicest exception to that 
pattern that I've seen in the last two years or so.

Can I officially request that we award Goran a medal for the 
"Refactoring of the Year"? Something that basically nobody noticed but 
that has a profound impact on network performance and reliability 
certainly qualifies for that.

Cheers,
    - Andreas



More information about the Squeak-dev mailing list