Main Content

The fragility of pancakes - and better structures

Archive - Originally posted on "The Horse's Mouth" - 2006-06-26 18:09:20 - Graham Ellis

Have you ever hunted around a directory for a file ... you KNOW it's there, but you can't find it - can't see the wood for the trees, if you like, in a listing that spills over many pages?

I call such directory structures "pancakes" as they're thin and flat, and they tend not to be very easy to work with as they grow and grow. It's usually best to avoid a pancake if you can - either set up a directory structure if you require ad-hoc access to all the various different data pieces, or use a database such as MySQL to hold the data ... this is the technique we're using for images in our database, as described in the current edition of "Of Course".

The Authors of Tcl had an issue with a pancake of commands that could have been provided in the language, so that came us with a hierarchy of commands and subcommands. Within a top level around a hundred top level commands, you'll find commands that have subcommand in particular areas such as
string - most commands to do with string handling
file - most commands to do with file handling
array - all commands to do with array handling
clock - all commands to do with time handling
info - commands that provide information