Tales From The Geek Side

The geeky musings of Greg Rowe.

Archive for the 'Code' Category

TCL filter for Doxygen

May 7th, 2006 by greg

I wrote a filter that translates TCL code into something that sort of resembles C code. I wrote the filter so that you can use Doxygen on TCL code. I wrote it with the intention of it being used at work. I spent a very small amount of company time working on it. Most of the development time was while I was travelling for work while on planes and while waiting for planes. My employer, Impact Technologies was kind enough to allow me to release the code under the GPL license.

Category: Code, Geek | 4 Comments »

A couple coding pet peaves

April 1st, 2006 by greg

I’ve already written about one coding pet peave but I felt that I should share a few more. …And no, this is not an April Fool’s Day joke.

The pet peaves in this post are about needless use of constants, the bad name that early returns have earned, and copy-and-pasting code.
Read the rest of this entry »

Category: Code | No Comments »

Don’t be a commenting idiot

March 19th, 2006 by greg

All too often I see code that is commented like this:

/*
Function: foo
foo does baz to bar
*/
int foo(int bar);

This is stupid. It is obvious that the documentation block is describing the foo function. This type of commenting is extremely common and I don’t understand why programmers feel compelled to waste their time like this. I’ve seen this practice required in coding standards! The only time this practice could be considered acceptable is if you are using a documentation extraction tool that can not parse your language. If you are using a tool like that you ought to use something better (or write your own, it’s not that hard). Java has javadoc, for C and C++ there’s Doxygen.

Category: Code | 1 Comment »