Sunday, July 29, 2007

5 Lessons From Triathlon

I'm in my 3rd year as an intermediate level triathlete, and have noticed that there are some parallels to software development. Some of these aren't new but I find the similarities to be interesting. (Many of these are true for all kinds of hobbies.)

Machines are brutally honest

Whether its developing code, or running a 10K, the stopwatch and unit tests show no mercy. Emotion and passion have their place, but the cold hard facts are, well, cold and hard.

Give the problem to your subconscious solver

I am constantly amazed at the power of taking a break or coming back to a problem after a night's rest. The subconscious mind is a powerful thing. This is true for many hobbies (anything that distracts us), but I think especially for endurance sports. It is easy to let go of a problem if you are going 18 mph (29 kph) on a bicycle.

Interestingly, of the 3 sports, the swim is often the most pensive for me. After 45 minutes in the pool, all of the world's problems seem solved. Many of these blog posts originated in the pool.

Learn tricks from the community

I have a blog post on the importance of talking to fellow IDE users about the tool: you can learn a ton of new things.

Similarly, in triathlon, there are a zillions tricks that people use to reduce time, especially in transition. One example: some hardcore types will clip their bike shoes into the bike prior to the race. After the run segment, they ditch their running shoes and hop onto the bike at a run (barefoot), and wiggle their feet into the bike shoes at 8+ mph. This is entirely analogous all of those wonderful keyboard shortcuts in Idea, Eclipse, etc.

Variety is fun

If I don't want to swim, I can bike. If it's raining, I'll run on the treadmill. Options! And yet I am still doing something. That's cool.

The point here is so obvious that I can't bring myself to write it. How about: Swim, Bike, Run sure seems isomorphic to Scala, Beanshell, Ruby *wink*. (Though I recommend Groovy over Beanshell).

Challenge is growth

Not all triathlons are the famed, insane "Ironman": the distances vary all over the map. I signed up for a triathlon in September: it is a distance that I honestly don't know if I can do. We'll see, but it has certainly given me motivation to train more.

A colleague recently pointed out a similar phenomenon for learning comp sci: volunteer to write an article, teach a class, or give a JUG presentation. If you don't know the subject well enough, then all the better: because you're gonna have to. It's a frightening X weeks of preparation but exhilarating.

And it's a great feeling to hear the applause at the finish line.

Friday, July 27, 2007

Stuff That Happened: Blog Bankruptcy




CtJ Editorial
Artistic License, MO
July 2007


Eric Burke is alive and well. Sources tell the CtJ newsdesk that he is tanned and well-rested.

However, his blog Stuff That Happens has a recent post that the site will be no more. Call it Blog Bankruptcy.

The move has raised eyebrows throughout the tech blog community. The site was a successful, interesting mix of strong technical insight, moderately humorous asides, and the occasional pointed rant. With its medley of content, the blog was an archetype for a new generation of "post-modern" tech blogs, as exemplified by Code to Joy.

For many, though, the announcement is the final denouement of a steady slide of the blog persona. After years of success, and a remarkable peak of innovation with the now-famous "I *heart* POJOs" post, the blog began to descend into the abyss. Consider the final weeks:

  • A contest inviting people to send stuff to his open-sourced snail mail address
  • A contest inviting guest writers to debate a topic -- any topic
  • Ambiguous use of the term craptastic
  • A mini-series on screencasting, with a conclusion that involves an unusual penchant for working with bamboo floors and the quote "I'm quitting computers"
Sad, but true. A seemingly desperate blogger who, like a slumping baseball player, swings for the fences on the first pitch. The persona evolved into a theme of a maniacal despot of a tiny island nation, giving deranged orders to puzzled generals and lieutenants.

A Ruse?

Is it a ploy? Some kind of grand scheme in the vein of American comedian/performance artist Andy Kaufman ?

Will "Stuff" return -- perhaps as a new blog? Can someone who writes such passionate rants actually walk away from the pulpit? The author is strong in Swing, concurrency, and other aspects of Java -- can he suffer the slings and bugs of outrageous JDK libraries and not tell the world?

Who knows.... But a tip of the hat to venerable Stuff That Happens, and an invitation for its readers to join the orchestra at Code to Joy. Come along, it'll be joyous!

Monday, July 23, 2007

Tuesday, July 17, 2007

isPrime in One Line of Groovy

This line of code is inspired by this post on primality in Perl.

$ groovy -e "println new BigInteger(args[0]).isProbablePrime(99)" 19
$ true <--- i.e. 19 is prime

I suspect that this will be considered cheating: (a) it evaluates "probable" primes and (b) it isn't in the spirit of the game. But still neat, n'est-ce-pas?

Final Score

JVM Tunnelers 1 Cryptic Scripts 0

Monday, July 16, 2007

My Next Book Purchase



I'm excited about this new book from O'Reilly.

I generally enjoy books on "philosophy of computing" but check out the authors in this one: Brian Kernighan, Jon Bentley, Tim Bray, Elliotte Rusty Harold, and so on.

Wow. And the kicker: author royalties go to Amnesty International.

Sign me up.

My only wish is that O'Reilly and Amazon, instead of offering "get a 2nd book for 30% off", would offer "buy 5 hours per week to read your new purchase!"

I'm telling you: the bookseller that first sells time will make millions.

Thursday, July 12, 2007

Easter's Corollary to The Miller Principle

First, check out the sublime, brilliantly phrased Miller Principle. I humbly submit the following...

Easter's Corollary: Everyone scans.

Scanning is like Reading Lite: all of the eye movement, without that cognitive aftertaste. With the hectic pace of today's society, and the e-torrents of text, scanning is a great way to almost upload information into our consciousness.

The act of scanning is addictive, as people feel justified in commenting on something they nearly read.

Office synonyms for "scan" include "peruse", "check out", and "take a peek".

Example usage: "I wanted to choose a web framework for the new portal project for Finance, so I scanned the Readme file of Acme WebSoft. Looks pretty solid to me."

Sunday, July 8, 2007

Seven Wonders of Programming Languages

As is widely known, there has been a massive effort to vote for the New Seven Wonders of the World, an update to the classic list of antiquity.

A fun thought experiment is to list the 7 Wonders of Programming Languages.

Imagine someone is new to our planet, civilization, or computer science. You want to show them the definitive list of programming languages: 7 wonders. What do you pick?

Making a list is easy. Trimming a list is difficult, and that's the problem with Seven Wonders.

Especially when you consider all of the available languages. For a wonderful evolutionary map, see this photo from Wired.

My list is below. Roughly speaking, my criteria are:

  • Proven track record and legacy. Sorry, Groovy, much too soon.
  • Success either in terms of influence or outright usage. However, sheer popularity is not enough.
  • Consideration for brilliance and innovation.
  • Admittedly, there is some blurring of the line between pure syntax and the platform/libraries.
Here is my (biased) list, in approximate chronological order.

1. Fortran

Assembly is older, the Turing machine is much older, but Fortran takes the prize as the grand-daddy of computing. It is arguably the "Proto-Indo-European" of procedural languages. Indeed, it was ugly, was not as influential as, say Algol, and had major problems, but it has a strong argument for being "first".

2. Lisp

For decades, university profs have whipped out this functional language when they want to mess up students. After an initiation to the Algol-based languages, there is no preparation for a mind-trip without for loops or if statements. Massively influential in its space (i.e. non-procedural computing).

3. Smalltalk

Though Smalltalk never seemed to break out of its cult-following, it pretty much nailed OOP right on the head in terms of execution. Smalltalkers are rabid fans and the general community spawned a stunning array of ideas, from OO concepts to library design and development methodologies.

4. C

Does this language need an explanation? Though the syntax is still a bit smelly, even after all these years, this is the definitive iron workhorse, the Lou Gehrig of languages.

5. Python

Python is on the list for 3 reasons. One, it is an educator's dream. It is easy to learn and so friendly that the interactive window harkens back to a simpler time of computing. Second, it is extremely effective for handling the "currency of computing" -- strings. Finally, it is an excellent example of a language that "stays out of the way" even when projects scale in size (i.e. it can be used for newbie programming or high-end applications).

6. Java

Some may sniff that Java has been a hype machine for 10 years. Wrong. The hype has been huge at times, but I think Java is actually under-rated. With a strong lineage to C++ and Smalltalk, Java got a lot of things right. Reflect on the JVM, packages, naming of classes/files, Unicode support, reflection... the list goes on. One day, historians will say that the pervasiveness of Cobol "was like Java, only smaller in scale".

7. JavaScript

A tough call for the last spot. One can try to defend the theoretical side of JavaScript -- I once heard in a conference that the author was influenced heavily by Lisp. One can try to point out elegant examples of its use. But the truth is that it is inseparable from its platform and rides that tidal wave into this spot. Just as C gave us definitive access to the filesystem and sockets, JavaScript gives us the DOM, and Ajax. When you have connections like Google Maps, well, you get red-carpet treatement.

There's the list.... let the flames begin!

What's your list?

ps. Honourable mentions to C++, Visual Basic, Cobol, Perl, and APL.