rosscarter.com

Commentary

31 March 2009 | No Comments

When Programmers Dream

For the past four years I have been engaged pretty heavily in developing a computer application. A typical day, seven days a week, finds me at work shortly after I’ve finished reading the morning paper, and still programming ten hours later.

During this period I have grown familiar with trained and experienced Mac developers. I follow their blogs and tweets, and meet up with them at conferences. As I continue to know and understand developers, I find myself comparing them to the other profession that I know fairly well: lawyers.

I practiced law for twenty years or so. Happily, I am now fully recovered. The lawyers that I knew were without exception trained in the law (well, they had three years of law school) and many were quite highly experienced. You might think that with all that education, and all that mental exercise, lawyers as a whole would be fairly smart. Maybe they are. All I know is, Mac programmers are smarter.

Most of the Mac developers I know have a computer science background, but it is not at all unusual to find one who, like myself, is self-taught. One cannot say that programmers are smarter than lawyers because programmers are better educated. Yet on the whole, when I think of the conversations I’ve had with members of the two professions, the programmers seem altogether more articulate, better informed, and more adept at reasoning to their own conclusions. I had much rather talk to programmers, on any subject, than to lawyers.

As for myself, well into middle age, my logical faculties seem to be increasing. I’m slower, but sharper than I ever was. The thought struck me this morning when I remembered a dream I had last night. I was running along a beach, being chased by a pack of angry savages. I outran them and paused to ponder their next move. “Spears and arrows,” I thought. “What can I do for protection against the incipient barrage of spears and arrows?” I spied a thicket, and crawled into it as the projectiles became tangled in the brush over my head. Then I thought, “They know where I am, and will track me by my footprints. How can I escape from this spot without leaving footprints?” Then I remembered the beach. “I’ll swim!”

Whether the pursuers would have seen me in the water was left unresolved. What is clear is that in this dream, I stopped to reason things out. This dream is not at all unusual. I realized that these days my dreams are more likely to place me in a situation where I have to think my way out, than to place me in a situation where I merely observe events.

Is that a consequence of the type of thinking I’ve been doing lately? I certainly never had such dreams when I was practicing law.

And here, I posit, is why. We expect computers always to produce the same result for the same input. There are few, if any, anomalies; if something unexpected happens, then it’s a bug and we fix it. The operating system or the network might not provide the result I expected, but it will always produce that result, and once I know the result I can deal with it.

In law, anomalies are commonplace. Two judges, both competent (just imagine, if you will), might rule differently on precisely identical questions. Tomorrow they might rule differently. I remember one day early in my career when a lawyer in motion hour made the same argument I was going to make in my case. He won. When my case was called, I made the same argument and lost.

I think that if judges were as predictable as computers, I would have been the sharpest lawyer in town.

Over time my professional judgment improved, but I never worked in a cycle where I proposed a solution, evaluated the result, and proposed another solution until I got it right. Many times I knew beyond question that a proposed law was unconstitutional, but no court in the state would be willing to strike it down. I was a better lawyer for knowing that, but not any smarter.

I learn more in one day of programming than I learned in six months of practicing law. I learn how to think through problems and how to reach the true solution rather than just finding something I can argue with a straight face.

This entire essay is mere subjective speculation, and I am blithely unobligated to cite corroborative facts. Form your own opinion whether programmers are, on the whole, smarter than lawyers. For me, there’s no doubt. You’re a lawyer? Nice to meet you, but I really have to be going. You write Mac software? Come on over, I’ll buy you a beer.

17 January 2009 | No Comments

After 39 years, I finally use the quadratic equation

When I was in high school, my buddies had a simple test to tell when we’d had too much to drink. If you could could recite the quadratic equation, you could have another beer.

Whether the test kept us sober I can’t recall, but it did drill the incantation into my memory: “negative b plus or minus the square root of b squared minus four a c all over two a.”

If I ever knew what you would use the equation for, it quickly faded along with a thousand facts like the population of Guyana, retained only for the duration of a geography test. Over the years, though, I’ve caught myself checking my mental state by reciting the quadratic equation, so those words stuck, like the first stanza of “O Captain My Captain.”

Yesterday I needed to convert a linear scale to a logarithmic scale. I’d set up an NSSlider control that allowed the user to select values between 0 and 1. I wanted to weight the values so that the halfway value would be .75 instead of .5, the three-quarters value would be .95, and so on.

After some trial and error I found that I could get the logarithmic scale I wanted by taking the slider’s value x and running it through this formula:

y = x + x * (1.0 – x)

That’s exactly what I wanted: the slider values 0, .1, .2, .3, .4 .5,.6, .7, .8, .9, and 1.0 came out as 0, .19, .36, .51, .64, .75, .84, .91, .96, .99, and 1.0.

Then it dawned on me that I also had to perform that operation in reverse.

At first I was totally bewildered. I tried rewriting my little formula to get x on one side by itself so I could solve for it. No luck. y = x * (2.0 – x), y = 2x – x squared, -y = x squared – 2x; I just couldn’t come up up a solvable expression.

Then I remembered the quadratic equation.

Hmm. I tinkered with my formula and got it into the form 0 = x squared – 2x + y. Aha! In the quadratic equation, a would be 1 (the value that you multiply times x squared), b would be 2, and c would be my y value. I could then solve the quadratic equation and get x.

A little tinkering with the quadratic equation reduced it to this: x = -(((square root of (4.0 – (4.0 * y) )) – 2.0) / 2.0). Imagine my joy when I plugged in the logarithmic y values I had calculated earlier and got the linear x values.

I learned the quadratic equation as a sophomore in high school. That was thirty-nine years ago. I’d never encountered a practical application for it until yesterday. I guess high school taught me useful things after all.

Now, excuse me while I go look up the population of Guyana.

15 October 2008 | No Comments

Without a comma, the clause isn’t subordinate

In Microsoft’s description of their Open Specification Promise they state:

We listened to feedback from community representatives who made positive comments regarding the acceptability of this approach.

Because the sentence implies that they didn’t listen to feedback from representatives who made negative comments, I’m inclined to believe that the omission of a comma after “representatives” was deliberate.

18 September 2008 | No Comments

Back, but just barely

What a week! Who would have thought a hurricane would knock out power in Louisville for 2 weeks?
Read more »

27 August 2008 | No Comments

The Adobe Install Experience, part 2

I had everything installed, and decided I wanted to look at the crud in my Applications menu with a view to removing it. I started with Adobe Stock Photos.
Read more »

27 August 2008 | 9,673 Comments

The Adobe Install Experience, part 1

I recently re-installed Abobe CS3 from scratch. Whether the experience was typical or not I leave to you to decide. Here’s an event-by-event description.
Read more »

20 July 2008 | No Comments

Cornwall pics

I finally got around to looking at our Cornwall photos.
Read more »

28 June 2008 | No Comments

More Paris

We visited the Musée d’Orsay, home of the Impressionist paintings.
Read more »

25 June 2008 | No Comments

City of Light

Bonjour, nos amis! Nous sommes ici à Paris!
Read more »

25 June 2008 | No Comments

Stockholm Pics

Some photos of Stockholm and the voyage back into the Baltic.
Read more »