Posts Tagged ‘documentation’

Funny ways to document code

// May 22nd, 2009 // No Comments » // Programming

While I do try to document my code as best and efficiently as I can, I will admit that sometimes I like to get creative. As I was updating a particular file, I came accorss an old block of code that read as follows:

/********************
* Product lists holder
* Contains 1 table with 3 columns
* I can’t figure out a way to automate this.
* Logic: List is alphabetical, BUT we HAVE to plop in some products from a different letter group
* Problem: The out-of-place products need to be placed in a specific place (where they told me to place it in the list, in case you’re wondering)
*            This means I can’t find a way to have a product find it’s own place in the list. This causes me to hard code each product link,
*            thus, I can’t automate looping all 3 columns in one smooth loop.
* To my replacement: If you can come up with a way to fix this mess email me at xxxx@gmail.com and let me know how you did it
*/

You are all free to flame me for this if you wish, but hey, I was younger and less experienced. The problem I faced that prompted to write that comment is having to display the company products in alphabetical order in 3 columns. That was easy enough, but the problem came when customers started complaining that they couldn’t find certain products. Lets say one product is called Super Product, and another product or very similar features and quality is called A-Super Product, that “A” made it fall into the -A- section of the alphabetic list. Now I am tasked with puting A-Super Product next to Super Product in the list. And the rest is explained in the comment code above.

Now I wonder who else has done similar things, leave your “creative documentation in comments below.