Project Upkeep

We all do it, or have done it in the past. We work on a project, and as it grows bigger, it begins to look ugly. You have to remember where everything is and exactly how everything works. And if you leave your project for even a week and come back, you're lost in your own code and have to re-remember how it all works. Your project becomes a nightmare to work with.

This often comes with lack of planning, feature creep, or lazy coding. But for many of us hobby programmers, who like to just jump right into coding, how do we deal with these issues as our project grows bigger?

Every so often, I take the time to do the things that I've put off, such as adding comments and organizing my code. I'm not always in the mood to write clean code. But I make sure, before everything turns into spaghetti, that I take some time to clean things up.

Some days I don't feel like coding, but I still feel like getting something done. So instead of coding, I work on commenting my project. I'll add comments, or reword existing comments to make them understandable for my future self. I'll also spend the time to think about how I can make my code more organized, simplified, and structured. It doesn't take too long and it is time well spent.

Don't be discouraged into thinking that it's a waste of time. You'll be more productive working with cleaner code, and it makes it that much easier to come back to if you ever put your project on hold. And as your project grows larger, it'll be much easier to manage.

Also, try to break things down into simpler components and processes when things start to become large and complicated, but not before things becomes so large and complicated that it becomes a full-time job. It's similar to taking a few minutes to vacuum the living room every week as opposed to taking a whole day to clean living room every six months. Though, when it comes to coding, it could take days, weeks or months to clean up after six months of lazy coding. It might even be so discouraging that you decide it would just be easier to start the project over.

I've been able to come back to projects a year later and, without any problems, resume where I left off simply because I did this maintenance every once in a while. It's a great feeling knowing that all the time and effort you put into a past project wasn't in vain, so that you don't have to scrap your old project and start over.

1 comment:

  1. Hmm, this is definately a technique I need to work on hah ;). I have recently started to use doxygen for my C project, and it's really nice. It automatically generates documentation (for devers) as to how your code works/is structured, and if you haven't commented your functions, the documentation clearly shows it - making you want to document it all.

    But other than that, after 4 years of not coding much (University) and back on the scene, I still have a billion projects/ideas to work on and none of them are that organised.

    However, lately (past few months) I've been using an exremely simple wiki software on my homepage that I can organise all of my coding ideas, projects, etc, and also other stuff. It's really working great - I'd encourage you to try it (DokuWiki). It really kicks ass. I just need to organise more of my current project on there, when I get time.

    ReplyDelete