Friday, August 22, 2008

A Change in Programming Style

I am sitting in Amante coffee shop in Boulder, just kind of doing a bit of code and waiting for the night to start. A salsa band is playing soon nearby and I need to burn some time.

A jazz band just started to play in the shop and they are quite melodic and smooth.

It is almost worth it to just sit here and chill, thinking about random thoughts about life and lambdas.

A while back I started to get a few symptoms of RSI. Mainly I was getting tendinitis in my fingers. It *still* isn't gone but it is a lot better than it used to be.

But that experience really prompted me to think about what I could possibly accomplish at the end of the day. It occurred to me that I really did a bit more work than I needed to. I would spend a lot of time typing something, think of a better way, and then spend a lot of time typing it again.

Needless to say, on large projects this was just not going to get me anywhere. I would also get frustrated with how mundane some of the code I was writing was and just writing absolutely as fast as I could. This was somewhat effective, but I also would not necessarily cover all of the bases when I did this.

Anyway, I still work pretty fast at times. This week is an intense week, I am working multi-pass effects into a somewhat sophisticated effect authoring system and really getting into it. They will be very powerful and quite beautiful when they are running, but what I can get done under the time allowed is only so much.

A large change has happened when I am working on my own home projects. Rarely do I spend more than about 10-20 minutes typing. A lot of time I spend just looking at the code and trying to figure out some way to do what I want to do with the least amount of typing.

I spend a lot more time researching different ideas and trying to figure out what language theorists are up to. I spend a lot of time just trying to visualize how I would like whatever I write to look like when I am done.

In any case, I don't type nearly as much. I also don't type nearly as quickly.

Now for an interesting although really obvious thought. The longest lived systems tend to be the most programmable. It is one thing to design your application for plugins and such but that is a very...boxed sort of programmability. Shove scheme or javascript into the application and enable a sort of live editing and updating. Excel does it pretty well! So do a handful of other applications.

But the point is, the more programmable you build the application the better off you are. Don't have a fixed data model, avoid anything fixed if it is an application of any significant functionality. Live coding is where it is at, why code any other way? I love F# and haskell; those work well for foundations. The top layer needs to be typeless and crazy dynamic.

Chris

No comments: