Dec 14 last year was Global Code Retreat Day. Intel and Puppet Labs as sponsors for the local session provided facilities, food, and co-ordination of the event. Local software folks got experience with or, at least, exposure to new tools and techniques. The hope of Code Retreats is to promote better development practices and improve the quality of software that gets released on an unsuspecting public.
That’s not what happened in my case. I lost two of the 45 minutes coding sprints spending about 40 minutes trying to set up a JUnit test suite on my machine. If you don’t know what that means, apparently neither do I. I have the notion of how it all works. I like Java and the Eclipse IDE, but I don’t spend any regular amount of time using them. I found myself thinking “I know that I know this. Why don’t I know this right now?”
I do know something about using The Hessling Editor. In two of the coding sprint sessions I encountered people who using advanced software frameworks but not using IDE’s (Integrated Development Environments). VIM was the editor of choice for the Ruby session. And EMACS was used for Clojure development. During a recap, I publicly confessed it made me feel less out of touch for using The Hessling Editor in my daily work.
It also resulted in a contrarian compulsion. The rules of Code Retreat are that you have to throw away your code at the end of 45 minutes. What you get to keep is the your experience working with different approaches to the problem. The approach that worked best was mapping the Game of Life grid into a list. It’s just a small step from using a list to using a string, something the Rexx language handles very well.
Not only does Rexx handle strings very well, it’s the language that The Hessling Editor uses for edit macros. Edit macros can do all sorts of things to test and manipulate edit session contents; and displaying and manipulating file context is the basic function of any text editor. All the parts were in place.
“This should be easy”, I thought. There’s no way that anyone with even a little bit of code hound in them can think that, and not feel compelled to go for it. It wasn’t going to be done in 45 minutes, but I don’t see any big logical obstructions to constructing this thing.
There’s a Murphy’s Law of Software Development that states: “If it looks easy, it’s hard. If it looks hard, it’s impossible.” Apperantly nothing is exempt from Murphy’s law, including Murphy’s laws. Aside from the normal missteps and typos, the code laid down pretty smoothly.
Kathie, my better half, was laid up after oral surgery on Monday after the code retreat, and in between keeping an eye on her, and fixing chicken soup; I managed to put some time in
laying down code. The code I wrote set up a special edit session that would draw the active screen and let me lay down and remove X’s to seed the game before starting the generation process.
In a sense, my process did employ a test driven design strategy: what I coded first was the interface that I could use to set up tests and see how well the generation code worked. Coding the generation process took about an hour and a half the next evening.
The primary complication was the nagging feeling that this project really wasn’t any where near the top of the List of Things I Should be Doing Right Now, especially during Christmas. Balancing that nagging thought against the distraction of a compulsion not tended to, I chose to tend to the compulsion and get it out of the way.
Again, that wasn’t what happened. After a day plus a couple hours, I had created a game of life environment that allowed me set up and run different scenarios. I gave a quick demo to Joseph Cunningham, a colleague at work, and he said “That’s cool. You ought to do screen capture and make a video of it.” The compulsion, only briefly in a dormant state, was revised and renewed.
The section of code that trapped keystrokes and moved the cursor was expanded to permit drawing vertical and diagonal lines. With a moderate dose of refactoring the new functions fit right in. In order to get a better video I also made a couple changes to optimize its performance. Again, the process was void of frustration; maybe because I was using my favorite PC-based editor to code and run it.
My GameOfLife edit macro isn’t robust enough to encode the game of life in its sessions, so I decided to run the game of life on “GAME OF LIFE”. Here’s the video:
THE Game of Life
One thing Joesph said was “You’ll have the only video out there on running The Game of Life in The Hessling Editor.” He was right. In fact, although there are thousands of videos on the Game of Life, I haven’t been able find another video that features The Hessling Editor. Not exactly going viral, but the video makes the first page of Google results for The Hessling Editor.
As I said, the goal was the scratch the itch and get on to other things. Results were otherwise. Since making the video, I’ve made additional enhancements and tested some patterns. I’m not currently tinkering with the code, but I’m not finished with it either.
Meanwhile, another Code Retreat is coming around, March 22. Check it out for yourself.
Portland Code Retreat
Global Code Retreat
It’s good way to spend a Saturday. The event is well organized. The experience may be enlightening, and, maybe afterwards, you’ll do something of real consequence.