This morning I had to dive into some code I didn't write to try to figure out why it was [boring technical details of the actual error omitted but it was broken, ok?].
You might have heard the term
"code smell" - this code doesn't smell, it stinks. It stinks of many things, chiefly convoluted OO design with about thirteen too many layers of
(
Read more... )
Comments 2
Reply
The immediate problem - when I actually found it; there were two almost identical sets of nested methods doing very nearly the same thing, in two different and almost orthogonal classes - had logic which was so poorly thought out that it really did seem as perverse as a chair with spikes coming out of it. The kind of code that you can't believe someone wrote in innocence - surely it must have been deliberate. (I've had that experience with my own code, which is worse.)
And of course the reason this stuff persists is that refactoring it would be horrifyingly slow and brain-destroying; on the other hand, "let's rewrite it again from scratch" is never a popular option. I'm trying to come up with a strategy to rewrite it one chunk at a time.
Reply
Leave a comment