Thursday, April 30, 2009

Riding across the Rio Grande

Existence comes to me.

Read at your own risk: I wrote the following from an experience I had riding across the Rio Grande Bridge on Montano in Albuquerque.

The "Material" throws me. Throws everybody.

Time throws me. How can you take a concept like eternity seriously?

Existence comes together with that singularity of creation called the Big Bang. ...when something wasn't, and then it is.

It has nothing to do with reality because reality, like time, is our perception. It's more like the seed of a nightly dream. The lifetime of that dream is the lifetime of the universe as a collection of physics that is only defined as told in the dream.

Too dreamy?

Well, look on the other "side" of that singularity. There are no physics. Or no One physics. There is only dream potential where walls are not defined. Limits are not defined. No carbon. No gold. No nothing. Only, maybe, the one thing we can speculate that exists is Energy?

There, there is no time. There is only eternity. Eternity, the word that ironically requires the concept of time in order to have relevance. If there is no time, then there is no need for the concept of eternity for there is no yang to its yin.

Now you can picture the other side of the sunrise called the singularity. Infinite possibilities. No need for questions about how old is anything. Or when will time end? It's relevant only to our existence called the Universe. It's like asking how long are we staying at Aunt Dorothy's house? Then it's irrelevant once we leave.

So if you ever felt like you're living a dream... you are. And you'll probably be around again to live it again because infinite possibility does imply you get more than one shot.

Wednesday, April 01, 2009

Playdough Programming

Revelations about new Web development technologies are getting to be a regular thing. The natural energies and consequences of open source projects and the rapid fire innovations they spawn (prototypejs.org) or legitimize (Ajax and the back-channel feature of modern browsers), life for software development bears little resemblance to disk drive-grinding Pascal compilers of the not-so-distant past.

The newest revelation for me is what I'm characterizing as "playdough programming." For someone who, as a boy, couldn't wait to paint my car models before the glue had dried, a language like Groovy has changed the way I tackle new programming tasks. 1. Get it going (i.e., start some tactical coding), 2. validate concepts and strategies early, and 3. then begin refining your project into something that gets early feedback. And because it's still basically a Java app, (modestly) refactor it into compilable code (if you think it's a necessity) and leave the rest to the Groovy components as library elements that can natively interact with Java code.

A quick example. In my job I wanted to know about patterns in collections of files in various directories. So I quickly wrote the following:

def grabDataFromFiles(directory) {
   def listOfFiles = []
   new File(directory).eachFile { f ->
        listOfFiles.add(f)
   }
   return listOfFiles
}
Pretty terse, eh?
listOfFiles
is an ordered list of file names. And
def
not only declares the function, it also returns the type "linked list" because Groovy uses duck typing, which you can choose to leverage or you could just go with the more formal Java declaration
List grabDataFromFiles(directory) { ...
Keeping this to one page, let me list some of the things I enjoy and value about Groovy.
  1. Greatly lowers barrier to generating basic functionality
  2. Code is testable from the start.
  3. Easier to get there with constructs like : ${'A'..'Z'}.each {}
  4. 100% compat with Java (Java to Groovy, but not other way around)
  5. Great for newbies

My most pleasant surprise, besides the pure joy of using and exploring Groovy, is the amount of code re-use I'm practicing. You just feel much more like _not_ rewriting existing functionality -- probably because it's so easy to locate and modestly rework where differences demand.

So far I haven't mentioned closures. In a future blog entry, I'll explain the other 90% of why I'm smitten with Groovy. And yes, insert "Ruby" here if you like. Same value. Same new world.