Thursday, July 19, 2007

Hardware Project Completed

[ no Delphi content here, go away! ;) ]

Months ago, I posted a coffee table design on this blog. Now I'm happy to say that the damned thing is finally completed and installed in my friends' apartment.

This is it - 58 kilos of solid ash, painted with very watered-down white and finished with two layers of wax. Walnut veneer was used for the inset.

finished coffee table 

More photos in my gallery, including details of the build process.

Friday, July 13, 2007

What I Tell You Three Times is True

When I was young and stupid, I made modifications to my code at will. A little here, a little there, a little everywhere. And I always knew what I changed and what I have to undo and what is still missing. Unless I forgot.

When I was a little older, I started marking changes that had to be undone with comments.

Then Borland (or was it Inprise at that time? Who cares) added TODO support to the editor and since then I'm writing

  // TODO 1 -oPrimoz Gabrijelcic : only for debugging, remove!
ThisIsUsedOnlyForDebugging;

This makes a nice entry in my TODO list, which is visible at all times.


Later I started adding warnings that don't show in the TODO list, but in the Messages window:

{$IFDEF LogSomething}
{$MESSAGE WARN 'logging of Something enabled'}

An added bonus of this approach is that $MESSAGE messages are shown by the command-line compiler. I always write code that contains no hints nor warnings and such messages really stand up from the normal compiler output.

Recently, however, I started to doubt my sanity. I caught myself writing

// TODO 1 -oPrimoz Gabrijelcic : testing, remove!
{$MESSAGE WARN 'An important module is disabled'}
rrEventLogger.LogEvent('An important module is disabled!', svWarning);
// Process;

(In reality, messages were more descriptive.) First line is warning me to remove this code before creating a release version of the program. Second line warns me when I'm compiling the code and the third one logs a warning into program's log. I had a reason for all this - I had to run this version at a customer for debugging purposes but I didn't want it to be used anywhere else.

Still, I'm asking myself since this day - am I being overprotective to myself?