Archive for the 'Programming' Category

LinuxWorld 2008 and PHP Meetup

Saturday, August 9th, 2008

Computer science super genius and Python proselytizer JJ Behrens and I returned to LinuxWorld again this year. We’ve been doing this together for many years with only the pesky birth of a child interrupting my attendence. As JJ says, the conference was disappointing. It does seem like it’s on its last legs. The decline of this conference matches the shrinking posse that I bring with me. Two years ago I brought my entire department with me. It was pretty cool to have six Clear Ink technologist all running around hassling booth people. Last year, my department had shrunk a bit and this year, the one guy I’ve got reporting to me is didn’t come because he’s on vacation. At least I had JJ and Carl to hang out with.

One of the most enjoyable parts of LinuxWorld for me is the spectacle of JJ asking booth people really hard questions. The atrophying conference meant there were fewer people to put on the spot, although we did give the NYT guy and the mobius strip gal some trouble. When we passed the foot massaging shoe booth, I realized what this was–spam! My conference has been spammed! Yuck!

After the conference, I had the pleasure of chaperoning Dmitri Gaskin, Drupal wunderkind, to the PHP Meetup at the CNET building. Dmitri is 12 years old and the son of Igor Gasowski, with whom I’ve worked at Clear Ink for the past five years. JJ and I both had a lot of fun sitting in Starbucks and advising Dmitri on various computer science topics. There was a time when JJ was fresh out of college and I had a few things to teach him. I now find it hard to understand him half of the time. Fortunately, I can still understand the things Dmitri tells me, although when he first explained CCK to me a few months ago, it took me a bit.

One thing JJ and I agree on is that young programmers should read Hackers by Steven Levy. Programming techniques are one thing, but it’s harder to acquire an understanding for history and lore of the craft.

Dmitri and I had dinner with Lee Springer at Chevy’s and then headed over the CNET building for the PHP Meetup. Joe Stump talked about a new system in PEAR for hosting your own repository channels. It’s obvious how this can help keep code straight, especially for a company like Digg that has many production servers. PEAR’s system for installing modules is similar to Apt or RPM. Having been coding in PHP for so long (11 years!), my tendency is to do things the “old way”. So, while I’ve taken sips of the PEAR koolade, I’ve never taken a big gulp. I’m still trying to sort out PEAR versus Zend Framework versus sticking with my FreeEnergy codebase.

Optimize the Most Significant Parts

Sunday, March 30th, 2008

There’s a general principle to optimization that many people miss, but seems so simple once you know it. I’m sure I first read about it in The Practice of Programming from Kernighan and Pike. You should optimize the most significant part of a program to get the most reward for your effort. The procedure is simple. Measure how much time the computer spends in each part of your program. There’s likely a loop that takes up a significant portion of the time. Optimize that part first. If you don’t follow this formula, you’ll probably spend a bunch of time optimizing what you intuitively think is slow, but it may not matter at all.

I’ve found that this approach applies equally well to optimizing money. For example, when you’re running a business, you have a range of expenses. Some of them are for tangible goods, some of them are for outside services and some of them are for salaries. Imagine an office with a fancy coffee maker. Everyone might think it’s a waste of money and a luxury, but the cost of that expense is likely minuscule compared to salaries. You’re usually better off figuring out how to improve efficiencies in your work process than going with cheapo amenities.

Of course, once you know how this work, you can use it deceptively. Politicians do it all the time. Watch how they talk about earmarks, or the apocryphal $100 hammer. You might agree that it’s not a good idea for a congressman to request a $1mil earmark for his wife’s employer, but even $1mil is nothing compared to the most significant costs to the U.S. budget: Social Security and Medicare. If you check the measurements, you’ll find that all the earmarks together total about 1% of the budget, which Social Security and Medicare are about a third. (Total federal spending is about $2.9tril, and Social Security plus Medicare is about $900mil).

I’m a relatively young person in my late 30s. I wonder if I’m not alone in counting on getting absolutely nothing from Social Security by the time I might need it. I’m not taking that chance. I’m saving money in a 401K plus whatever else I can beyond the annual limit of a 401K. I really wouldn’t mind if my taxes were 30% lower and I had to take responsibility for my own retirement.


http://kazeban.biz