An Important Programming Truth, re-discovered

August 22, 2004 at 4:00 pm Leave a comment

This is mostly a tip, but it does deal directly with my FAQ project… Tonight, I re-discovered an important programming truth…

All programmers who have looked at code they wrote 6 months or more earlier know that documentation is an important thing.. I mean, I have a hard time remembering having WRITTEN code for some projects, much less remembering the specifics of how said code actually works… All serious programmers should know that good documentation is absolutely essential for all but the simplest of code.

But, the programming documentation that is perhaps the most important of all is documentation for RECURSIVE FUNCTIONS… Recursion is so powerful if used properly… In a scant few lines of code you can acomplish a lot of complex work. But recursion code is also very difficult to scan and determine what is going on. (At least, with any code that actually performs a real-world job..) I re-discovered this important programming truth tonight as I worked out a bug in my recursion code…

My recursive function consists of a grand total of 6 lines of code. After having difficulty reading this code (which I wrote only about a week ago!) I now have written seven full lines of text (consisting of 102 words total) to explain how this code works.

Of course, now that I’ve written this documentation, we all know that this will be the most bug-free portion of code in the entire project, and I won’t need to go back and look at it for years, if ever… 🙂


Entry filed under: Programming General.

The UI Blues SiteCheck

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


August 2004
« Jul   Sep »

Most Recent Posts

%d bloggers like this: