16 Jun 2008 berend   » (Journeyer)

There are those days I feel I can better retire as a programmer. Or really hate the tools I'm using. Default parameters are deeply, deeply evil. Got recently hit by two Drupal functions that have completely flawed defaults: file_move and file_scan_directory.

Both take deeply flawed default parameters. The scan directory does a recursive scan, file move creates a new file if a file with the same name already exists. This is not apparent from the names, and you don't have to pass in the parameters to make this clear. If you're not deeply aware of this, you might get hit by a bus, like I was. I scanned a directory for new files, once scanned, I moved them to a subdirectory. But the subdirectory was scanned as well of course. So I ended up in a situation where I created more and more files, each with their own nice Drupal generated extension. Which caused some very serious problems for a customer.

I'm so glad I can program in Eiffel the rest of the time. PHP is a nice language, but it is extremely open for very costly mistakes.

Latest blog entries     Older blog entries

New Advogato Features

FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!