Monthly Archive for December, 2007

My Blog, Or Is It?

I wanted to thank everyone who read, and especially commented on, my My Blog, My Rules post a couple weeks ago.  It's nice to know that people care, and even better to know that they appreciate what I've done.  And apologies to Charlie for the firestorm.

So is this my blog?  Or is it everyone's site, and I'm the only one that can directly start new conversations?  It's public and the comment form is available to all, so the latter seems an apt description.  Weblog implies a log of something on the web, not necessarily any sort of community foundation, but that's really what a blog is.  I don't know how I feel about that.

I want an engaged audience, I want vibrant discussions, but I don't want an obligation.  But it seems unfair to want that pairing, because what's in it for that audience?

Thanks for being part of that audience, even the silent ones.

Programming Creativity

Creativity is an interesting characteristic, because it means so many things.  Bach was creative.  So was Picasso.  Da Vinci.  Shakespeare.  Thompson and Ritchie?

Is computer programming a creative endeavour?  My instinct says yes.

Merriam-Webster defines "creative" as "having the quality of something created rather than imitated".  So by definition, everything that is created is the result of a creative act.  But that is an overly sterile perspective, I think.  If I said the word "the", I would have created sound, but it surely wasn't creative.

Creativity, to me, means that you can create appealing things out of basic building blocks.  Painters use colors, composers use notes.  Everyone has access to the same colors and notes, but not everyone can create the same paintings or compositions.  Moreover, the appreciation of the whole should be at least partially divorced from those basic blocks.  When you look at a painting, you don't say "well, right here it's red X, but over here it's red Y".  Similarly, music can be appreciated without knowing what specific notes are played, you can transpose a piece up or down as long as you maintain the relationships.

I don't claim that that's necessarily a better definition.  It's certainly a more subjective one, but that's intentional.  Creativity is more than just the ability to create.  The characteristics of what's created weigh in.

So back to programming.  It certainly has the characteristic that complete programs are created out of basic building blocks (your language's syntactic constructs).  But is the result appealing, and can it be appreciated distinct from the basic blocks?  Here I'm a bit hard pressed to find an answer.  The user of a program certainly doesn't appreciate the programming, just the behaviour of the running program.  Is there any way to "view" a program outside it's syntactic constructs?  UML modeling (or your choice of comparable things) is one way, but that's not really the program anymore, it's a distinct and incomplete representation of the program.  Record the live symphony on a handheld voice recorder and play it back - not quite the same.

There is a visual micro-perspective on code.  Someone with no language familiarity (or programming familiarity, really) can certainly distinguish between chaotically formatted code and well formatted code (consistent whitespace, capitalization, etc.).  But that's not really the beauty of the program, that trait belongs to an arbitrary collection of characters, regardless of whether it's a program or not.

Now contrast my definition with that of an assembly line worker.  The worker certainly uses basic building blocks to create an aggregate that can be appreciated distinct from the individual pieces.  But he doesn't get to make the decisions for where stuff goes and how it fits together.  So is he really creating?  No, just building.

So I think creativity also requires some aspect of free will (within the constraints imposed by the medium, of course).  This would manifest itself by the ability to intentionally create non-appealing results, but choosing not to unless using it as a form of artistic expression.  Which brings up another aspect of creativity: expression.  When you write a program, are you expressing something beyond the program itself?

Programming definitely has the free will aspect, just ask anyone who has ever had to debug a mess of spaghetti code.  But I'm not so sure about the expression.  But I think that goes back to the ability to view a program outside it's syntactic constructs.  Is it possible to appreciate the creativity of a program directly, or is some sort of intermediate form required?  If you can't appreciate the creativity of a program, does that mean it's not creative, or just that it can't be proven created?

Music…

I have musical talent of a very mediocre degree, but I love listening.  Popular, rock, choral, new age, instrumental, anything that's interesting.  But what makes it interesting?  What about music evokes feelings?  Why are some collections of noises beautiful while some are appalling, even if they're made up of the same constituents?  A very perplexing question.

The basics of music are easy to explain: it's all simple rhythm counting and note counting.  Arithmetic at it's simplest.  But computer's can't compose music with any sort of competence.  If provided with examples, they can produce new "compositions" that are somehow derived from the examples, but it's not really new.  It shouldn't be that hard to follow the rules and make something original that isn't just noise, but computers can't do it.  I don't claim that I can do it either, but entities of my class (i.e. other people) can.

One thing that's interesting to me about music is how differently Heather and I experience it.  She knows the the lyrics to every song on the radio (except for KUFO, the local rock station), every Christmas song, and a host of others.  On the flip side, I have a relatively static collection of digital music on my workstation at the office, some of it dating back 10 years, and there are a pile of songs I can't sing along with, because I don't know the words.

Heather sings in a community choir as well as a church choir, and with above average competence.  She's not going to be touring the world and making millions of dollars, but for a stay at home mom with a pair of kids under four, it's hard to find fault.  She can't read music, she can only copy what she hears others sing.  She can't pick stuff out on a piano.  She can't count a rhythm.  All of those, you'd think, would be prerequisites for performing music as an adult.

I've got exactly the complementary skillset, though with generally less proficiency.  I can read music.  I can't play the piano but I can get a song across with one.  I can count a rhythm.  I understand the basics of music theory.

The conclusion I've reached is that it's all due to my ears (and/or my brain's aural processing centers).  I have great difficulty listening to spoken words.  I get by in daily life by augmenting speech with primitive lip reading.  This is why I rarely look you in the eye when I'm listening - too busy looking at your mouth.  I hate using the phone, because there aren't any lips to see.  As you might imagine, this probably contributes to me not knowing the lyrics of a wide array of songs I'm intimately familiar with.

But the non-verbal aspects of music (including the 'shape" of sung parts) ……. Heaven lives there.  The expressiveness the four weapons of volume, tempo, rhythm, and harmony can assault your ears with is breathtaking.  If you've got Incubus' Warning available to you, give it a listen, paying close attention to the baseline.  There's a little riff in there (just before the first chorus, I believe) that I could listen to over and over again.

To hear a piece of music slowly build it's richness, growing more and more full, voices weaving together in ever more intricate acrobatics, until it they finally all align themselves and the full force of the melody is heard…..  What I would give to be able to create something that evocative.

Tokamak is Offline

I've had a Linux workstation (named tokamak) as my primary computer for the past several years, and until this past year, work was exclusively Linux as well.  Tonight, for the first time in literally years, I took tokamak offline.  It'll come back on, rest assured, but it's off, and it's weird.

I got a new Thinkpad last month, and set up all my development environments on it using VMWare to virtualize Linux servers (as that's what all my production boxes are).  I knew it'd work before I did it, but I'm amazed at how smoothly it goes.  I use the host OS for everything, and just map shared drives, so all my code is executed strictly in a Linux environment.  I.e. my only Eclipse install is in Windows, and my only Apache/CF/MySQL instances are Linux.  Just use Apache to assemble my url-space out of the '/mnt/hgfs/workspace' directory (a link to my Eclipse workspace), and done.  I can have any set of servers online at a time, and manage all the deployed code on them from a single Eclipse workspace, even running the exact same copy of a given project on multiple VMs (for different CF versions, for example) concurrently.

iPhone vs. Blackberry vs. None

I used to carry a cell phone, but I haven't for the past year.  I don't miss really miss it.  Being able to whip it out and call someone any time I wanted to is nice, but not being able to call someone any time I want to is nicer, I think.  In our hyperconnected world, we, as a society, have lost "alone" time.  Sure, we're more dependent on others than we ever have been before (at least outside our immediate families), but how much should have affect our life?  With cell phones, plans can change at any time, and everyone can be told about it instantly.  That's good if you get in a car wreck.  Is it good when you forget milk at the store and call your spouse so they can pick it up on the way home?  Maybe I'm just a non-control freak, but I say that's worse.  The world isn't going to end without milk; drink something else.  Sure, it might be inconvenient, but maybe it'll help you remember next time.

I feel the same way on my motorcycle: the visor goes down and the world goes away.  If I'm late and driving a car, I rush.  If I'm late on my bike, I just don't care.  If I have to go somewhere and I've got the car, I leave as late as possible and drive fast.  With my bike, I leave early so I can avoid taking a route with traffic and/or stoplights as much as possible.  I don't know what the difference is, because it's not a conscious decision; it was a distinction I noticed in retrospect after I'd been riding for a while.

With that prelude complete, I'm debating getting a phone again.  I would love a device with JME that I could install my own apps on, but with the modern age, a solid browser is just as useful (probably more so).  Being able to whip out a computer that's always on and do something online real quick is of great interest to me, because I find myself consciously skipping certain things I want to do because getting my laptop is to much of a pain.  But I'm not sure I'm willing to pay the price of carrying a phone, both the permanent availability and the actual physical device being in my pocket (or wherever) all the time.  The iPhone is really quite a massive piece of equipment, and I already know what it's like carrying one of those around (ahem!).  The Blackberries are a noticeably smaller, but with a much smaller screen (smaller factor and dedicated keyboard).

An interesting dilemma to be sure, and with a large helping of irony on the side considering my profession.

I Am A Guitar Hero

Simeon, fine purveyor of electronic distractions, got me hooked on Guitar Here III last month.  I went over to his house for a Saturday of Halo and then some Chang's for dinner.  But unfortunately, his network wasn't cooperating, so we bailed on Halo and started playing Guitar Hero.  I have to admit that I was pretty skeptical having seen it played by others, but oh how wrong I was.  Eight hours later, with four aching hands, we decided we better go eat so we'd be able to type come Monday.

Of course, on Sunday I went an got my own copy (for the Wii), shelved Zelda again, and started rocking.  Tonight, I finished Career mode on "medium" (having already done Easy), after getting at least four stars on every song.  Now on to "hard", though I fear I have some unlearning to do.  With medium, you can play a finger per button, but not so much with hard.  Medium also didn't present any riffs that strumming only in one direction was too slow to accomplish.  I did try a couple songs on medium with alternating strums, and I cannot for the life of me get the timing to be smooth.  Between that and having to shift my hand up and down the neck, hard should present more than enough challenge, at least until I start memorizing some of the songs, so I can use my eyes to aid some of the left hand acrobatics.

The Custom Tag Body-Scope

I was working with FlexChart a little this evening and ran into an interesting situation with a potentially very useful solution. I don't claim to be the first to think of it, but it's the first time I've used/seen it.

I added a date preparation tag a while back, but I thought it'd be nicer to have a UDF that you could use instead, when you're building a descriptor inline. What I realized is that for very little effort, you can easily scope variables (UDFs or otherwise) to the body of a custom tag. Here's how it works:

<cfif thisTag.executionMode EQ "start">
  <cfset injectedPrepChartDate = false />
  <cfif NOT structKeyExists(caller, "prepChartDate")>
    <cfif NOT structKeyExists(variables, "prepChartDate")>
      <cfinclude template="udf_prepchartdate.cfm" />
    </cfif>
    <cfset caller["prepChartDate"] = prepChartDate />
    <cfset injectedPrepChartDate = true />
  </cfif>
<cfelse> <!--- end --->
  <cfif injectedPrepChartDate>
    <cfset structDelete(caller, "prepChartDate") />
  </cfif>
</cfif>

First, in the start tag, I (conditionally) add a prepChartDate UDF to the caller scope, and set a variable for whether I did it or not. Then, in the end tag, I delete the UDF if I'd added it to the caller. The part that I've greyed out is only needed because I'm using a UDF; it's a simple don't-double-define-a-function check. In this case, I'm opting to only expose the UDF if it won't conflict with what is already there in the caller scope. It'd be just as reasonable to shadow the pre-existing variable and restore it after the body. This latter approach is basically how Fusebox implements DO parameters, if you've ever used them, though it's mechanism is both far more elaborate and far more flexible.

I've obviously removed everything else from the tag definition. If you want to see the full implementation of xmlchart.cfm (where I used it), you can see it in Subversion (look near the bottom), and/or see it in action on the demo.