The faster your codebase grows, the less of it people will understand. When people don’t understand all of the code, they don’t see global patterns, and so they will reinvent little wheels all over the place. In theory, the development leads and the architects are supposed to watch out for these issues, but there are always places where redundant code can hide, and as the code continues to grow, even this watchdog function breaks down.
On Tuesday I wrote about the start of this week’s gig. Now that the week is over I guess an update is in order.
In summary; I failed to work miracles this week…
Monday and Tuesday were spent on the low hanging fruit. Lots of simple transformations that made the code less flexible made it easier to see the wood for the trees. By the end of Tuesday I’d moved the code into a library, slipped in several interfaces, mocked up a few things and written a handful of tests.
There was a good reply by Dr. Real PC on one of Joel’s discussion threads recently;
“The most important thing is caring. If you don’t care it doesn’t matter how smart you might be. If you aren’t interested how could you have the patience that’s required?”
How true. I think it’s reasonably easy to spot if someone cares about what they’re doing, or, perhaps it’s just easy to spot when they dont…
I’m getting a bit fed up of hearing the word ‘Refactoring’ when what people really mean is just ‘hacking at code’. Back in May last year I responded to Bob Cringely’s piece on how bad the whole idea of refactoring was; I still stand by what I said and, looking back, I think the key point is this:
“Not all code changing is refactoring. Refactoring requires discipline. You need to balance the risk of refactoring with the risk of not refactoring.
Codemonkey uk has an interesting piece on the use of explicit initialiser and destroy member functions rather than allowing object lifetime to be managed by the constructor and destructor.
Codemonkey uk comes down on the right side of the argument, in my opinion; explicit initialiser methods are devil spawn.
The problem with classes that have a separate init method, no matter what it’s called, is that the class can exist at least two states; constructed and initialised.
A new posting in the blast from the past reprints area. First in a series that compares CORBA and COM; CORBA - Reference Counting.
The one where I find that you can teach an old dog new tricks and almost use the ‘rocks’ word.
Just recently I’ve switched to using STLPort on two of the code bases that I’m working on. One of my clients wanted to use it because they were having some weird threading issues with the standard VC6 stl and their ’enterprise’ install of VC was too hard to patch with updated stl headers from dinkumware… (I’m starting to think that ’enterprise’ often means big, clunky, broken and incompetent, but that’s another story).
Hey, you comment spam morons, get a life and do something useful for a change. With MT Blacklist most of you are kept out (and I can see how effective it is from looking at the logs) and it takes me no time at all to clean up after the few of you that get through and post your pathetic excuse for advertising. One click on the email that I get sent when a comment is left adds your pathetic spoor to my blacklist and another click scans all other comments and removes the crap you’re spreading.
Reusing code is often harder than you’d think. Sometimes the decision not to reuse a piece of code but instead to write new code to do the same thing is not just a case of ‘Not Invented Here’ syndrome but is more a case of trying to ‘Use Someone Elses’ and finding that the fit isn’t quite right…
Writing code that’s reusable is hard but that shouldn’t come as any great surprise.
I currently have 3 quite different technology books on the go, and one waiting in the wings.
I’m re-reading Software Craftsmanship, McBreen’s ideas really appeal to me, but then I guess that may be because I went through an official apprentiship in a former life so I can see how the craft model might work well for software.
Next is Applied C++ which is an interesting ‘warts and all’ journey through the design of a graphics manipulation library in C++.