War of the programming syntax

I have this buddy that lives on the other side of my cubicle wall at work. We compete over technology alot and it’s fun. Whenever one of us finds some new Idea feature, web framework, OS distro or desktop widget the other typically has recently found something similar, then the war begins. It normally goes like:

“My Kubuntu is better than your OSX!”

“Your crazy! Look at my special window effects! See how the window squeezes in and out of view!”

“Your dumb! Look at my 3D switcher! It’s much more fancy than your stoopid window trickery!”

“Yeah but my Spotlight search lets me find and run apps by incrementally searching typed keys!”

“Big deal! I got the same thing with Katapult! And, aaaaannnnd, I can incrementally search my Amarok library with it!”

“But how many times have I heard you cussing on the other side of the cubicle because your sound wasn’t mixed between Flash and Amarok?”

“That’s only because your butt stinks!”

“My bodily odor has nothing to do with your glitchy desktop environment! And your eyes are crooked!”

Ok, our debates really don’t get that heated but we rarely ever proove either side of the argument. Our latest bout is between scripting languages. He recently started gaining an interest in Python while I’ve long been trying to force scripting languages (as well as XSLT) down everyone’s throat in the office especially since finding out about Groovy. (I’m known for such quotes as, “what the Hell are you compiling a Java file for when you can run that snippet interactively?”, and “No, no, no, no! Don’t map that if/else brick from Java to an XML file manually, give the classpath to Groovy and use this XMLBuilder”, and my favorite, “You’re still warming your lunch in the microwave? I cook my hot-pockets in the GroovyConsole.”) So now it’s Python vs. Groovy. I have to admit, that I have long been interested in getting familiar with Python. It’s scattered all over my hard drive in various Kubuntu apps, plugins, and desktop widgets. It has a very strong following and I recently read an article in LinuxFormat about IronPython, the man and the .Net mission. Let’s just say, Python is interesting. So interesting that I’m willing to put Groovy on the table and play with it for a minute. (I’m only putting Groovy on the table, not closing it in the upper cabinet, and my Python playtime is to last no longer than one minute, 60 seconds to be exact!)

Anyhow, yesterday’s challenge was to recursively scan a given folder in the filesystem and print the contents. Pretty simple and straight-foward task for any self respecting scripting language. (Pretty simeple and straight foward for any programming language at all.)


def dir_tree(dir_path):
     for name in os.listdir(dir_path):
             full_path = os.path.join(dir_path, name)
             print full_path
             if os.path.isdir(full_path):


def listAllFiles(path) {
   new File(path.toString()).listFiles().each {
      if(it.isDirectory()) listAllFiles(it)
      else println it

Today’s challenge built on yesterday’s challenge adding the requirement to print checksums of each file in a directory and subdirectories. I struggled with today’s challenge partly because I deelted yesterday’s code and rewrote it using closures and also partly because I was born slightly retarded as a child. (If you’re wondering how such a mentally challenged person can enter into such a technical profession then I’m wondering why you would read so deep into anything written by a retarded kid.) After rewriting again with methods instead of closures (and begging for help and free books on JavaRanch) I was able to append a ” << checkSum(it)” to the end along with an adhoc implementation of a checkSum method that talked to java.util.zip.CRC32. I later asked my buddy to implement GSpec in Python. While I’m not sure if he was concerned for the idea I do think it would be an interesting project. PSpec anyone? Holla…

2 thoughts on “War of the programming syntax

  1. What about python’s os.walk? That recursively walks directories, so I’m pretty certain that you could do the example in fewer lines of python.

  2. What about Michael’s moon.walk? He agnostically walks backward while the sparkle from random glitter give the appearance of foward motion. Seriously though, thanx for the tip Scot. I posted a quick followup using your idea.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s