Perhaps a year ago, I wrote some programs to deal with running a library database. The application worked nicely, but the programs were terrible--huge chunks of repeated, unmaintainable code.
A number of months ago, I learned a lot more about OO Perl, and went through a big refactoring binge and stuffed lots of things in modules.
A smaller number of months ago, I learned even more about OO Perl, and fixed some of the infelicities of the code.
A few days ago, I greatly generalized the code, so I can use the same modules to handle other databases I work with. This refactoring pass went very smoothly, and I felt confident. In the process I realized that one big chunk of the code is still appallingly bad; I spent a huge amount of effort on this elaborate solution to a problem that could have been solved much more easily if I had just used some templating system. (I had set up complicated modules to generate and process forms in a particular way.) So now I realize I have to go through and refactor this entire chunk to use TT or something, which will be non-trivial due to the complexity of the existing code.
When I'm finished with this, I will be in exactly the same place as over a year ago. I mean, I'll be a better programmer, and know a lot more, but this code has been in production use the whole time and no one knows I've done anything at all.
I suppose this is a good thing. But I'd like to throw in something neat, that I couldn't have done a year ago, or something.
</meditation>
You're doing fine (Score:2)
When I'm finished with this, I will be in exactly the same place as over a year ago. I mean, I'll be a better programmer, and know a lot more, but this code has been in production use the whole time and no one knows I've done anything at all.
You've actually accomplished something great, then. The code will be much more maintainable. I'd see lines of code eliminated as a good metric of how much you've simplified the system.
Throwing code out is liberating. Gets rid of bugs, too.
I suppose this is a
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
Re:You're doing fine (Score:2)
There's a scene in Revenge of the Nerds, where someone from Microsoft (I think it was Steve Ballmer) talks about what it was like working with IBM on OS/2.
The IBM developers were stodgy old mainframe types, who were very regimented, hierarchical and by-the-book. The developers Microsoft contributed to the project wer
Re:You're doing fine (Score:1)
Re:You're doing fine (Score:1)
On Refactoring (Score:2)
Cringely picked up on this [pbs.org] a few months back. When it comes to working bodies of code, going back and refactoring something stable is a waste of time. But Cringley's ideas of an army of helpful Refactoring Gnomes is specious,
You are to be congratulated (Score:2, Informative)
Usually, when I do major rewrites, bugs and problems inevitably turn up. It shows that you worked deliberately and carefully and tested well.
Congratulations!
And remember, it's the journey (becoming a better programmer) and not the destination (source code) that is all the fun.