Spiga

The Language of URLs

November 18, 08 by M. Holger

So, here’s a thought that occured rather spontaneously this afternoon.  What if URLs had a codified set of rules, akin to linguistic grammar?  Right now there is a minimal required form, that of protocol://host/<arbitrary-and-optional-stuff>, which is perfectly reasonable in a limited fashion.  What I’m suggesting is that <arbitrary-and-optional-stuff> have a set of rules as well.

Read the rest of this entry →

Personal Development

October 08, 08 by M. Holger

Muddling through the interwebs, as I do every day, I came across a few interesting thoughts on personal development, “Business-2.0,” and blog categorization.

Starting with the last element, is the addition of a “Thoughts” category.  A good place to drop half-formed ideas, random thoughts, and things that just don’t fit elsewhere yet deserve better than ‘Uncategorized.’  I guess this post is one of those “Thoughts.”

Read the rest of this entry →

The Switch Case

October 03, 08 by M. Holger

While working on some code recently, I noticed a preponderance — neigh, an outright overabundance — of swith/case logic blocks to control content.  What’s worse is that the input variable to the switch block happened to be the value of a specific hash key, which got me to thinking — what is the purpose of a switch/case block, after all?

Read the rest of this entry →

More on Code as Data as Code

June 05, 08 by M. Holger

As an addendum to yesterday’s little writeup on data-driven design, here’s another little (perl) trick I’m particularly fond of, that relies on storing perl code as a hash element. The cool thing about this approach is that you can actually have a configuration file written in, say, XML, that can then reference procedures which are actually defined in the configuration along with the rest of the parameters — allowing you to abstract it away from the core application 100%.

Read the rest of this entry →

Data Driven Designs

June 04, 08 by M. Holger

One of the main paradigms I’m interested in working with when writing new bits of code is the concept of ‘data driven’ logic. On the surface this seems simple enough, but for the uninitiated the premise is that one should be able to dictate the logic of a routine via the input data, while doing little (if any) actual coding.

For instance, I recently ran into a situation where I needed to manage a series of input and output files, moving them from point A to point B. Most of the time we just need to rename the files en-route, but occasionally other manipulation might be required such as encrypting/decrypting the files, filtering subsets of data out, or performing other tasks.

Read the rest of this entry →