SWM Seeking LTR with Beautiful Code
I've dated lots of code. I've had my share of one night stands (hell I've even paid for it). My longest relationships lasted about 9 months. I'm getting older though, and now I'm looking for some code to have a long term relationship with.I'm in a situation now that I've never really been in before. I'm the only developer on the project, and I'm looking at working with the same code base for several years. Since I started the project from scratch, I can't blame my predecessors for any blemishes. I have no manager, so I can't blame any ugly hacks on artificially imposed deadlines or poor design decisions made by non-developers. When I get stuck there's no one I can go to for help.The consequences of having a long term relationship with code is that I have to live with my decisions. Any line of code I write will be revisited at a later time, probably a lot. I'm married to this code. This is not some post-modern divorce-prone marriage either. This is a medieval catholic marriage where the only way out is beheading.The longer my relationship with a project, the clearer it becomes to me that writing good code is important. Good code is easily modifiable. This means that making a change is simple, rather than complex. The fewer side effects each change generates, the more easily modifiable code is. This has been a hard concept to get for me since I've only ever written quick and dirty code for short-term projects where once some basic functionality was accomplished, the code was never revisited. In a longer term project, code is rewritten, again and again as users dig up bugs and as performance issues slowly rear their ugly heads.