May 12, 2014

The Pony Principle

About 40 years ago, I was sitting complaining to an old programmer about problems I was having with a program I was writing. I have no idea what the project was or what the problems were. This was, after all, 40 years ago.

The old programmer started into his theory about how a program was like a pony. (Really, I am not making this up.) As I listened I realized that I had heard this story before. It was about failing to look past the first level of details when making plans. I had lived this story vicariously through the little sister of my high school best friend. Her Mom let her buy a horse. I got to see what happened before and after she bought the horse.

Just a note on accuracy: The events I am describing happened more than 40 years ago while I was still a teenager and I do not claim that everything I am about to tell you is factually correct. It is as I remember it, the difference between memory and reality is well documented. Aso, I was very much an observer at a slight remove.

Many young ladies become fascinated with horses. Although I have my suspicions about why this happens I can't really claim to understand it. Little Sister (LS from here on) fell in love with horses. She had it bad. She was always talking about how beautiful they were, how great it was to ride a strong horse, and well you get the idea. She loved the the idea of owning a horse. I do believe she hoped to keep a horse in the backyard and ride it to school.

I overheard many conversations between LS and her mother about getting a horse. LS wanted a horse, and she wanted her mother to buy it for her. Her mother was having none of that. The simple truth was that the family could not afford a horse even if they could keep it in the backyard. But, undeterred LS kept up the discussion. Finally her mother gave her permission to buy a horse on the condition that LS bought it on her own and paid all the costs of maintaining the horse. LS was overjoyed. At least she was until she found out how much even an old, well used, nothing special horse cost.

LS was (I hope still is) a creative, honest, and very hardworking person. She tried to get a job. Trouble is that the child labor laws in Utah, where we lived at the time, do not allow teenagers to work in most jobs. Pretty much the only thing she was legally allowed to do was babysit. So, she babysat. She started by telling everyone she knew that she was available to babysit. Then, when she had the money she took out ads in the paper. She did a good job and pretty soon she was spending every spare minute babysitting. The demand for babysitters in Salt Lake City during the waning years of the baby boom was unlimited. She made pretty good money for a young teenager and saved every penny she could. It didn't take that long to earn the price of a horse.

She went looking for a horse and had to face the question of where she was going to put the horse. Funny thing, before you can buy a horse you need a place to keep it and a way to get it there. That meant she had to find a stable and rent a stall along with access to an exercise area, some place to ride the horse. She found the most ramshackle excuse for a stable I have ever seen, the walls were nearly falling down, the roof mostly leaked, but it had a gate that locked, it was in a pasture that she could ride in, and that was enough during the summer.

She found a horse, paid for it, and paid a little extra to have it delivered to the stall she was renting. Joy oh joy! She was ready to start riding all day everyday! Except she needed a saddle and all the rest of the tack that is needed to ride and care for a horse. OK, she was not stupid, she had budgeted for those things and she bought a cheap saddle, bridle, rope, enough stuff to get by for a while.

Now she faced a problem she had not really thought about. Oh, she had thought about it, but thinking about it is not the same as understanding it. She had to visit the horse every day. The horse had to be fed, watered, and exercised every day. Sort of like having a baby, you have to feed it and change its diapers on a regular basis, not just when you want to. Trouble is that she did not have a car. She was too young to have a driver's license. The family owned one car, a nice VW bug. Mom was working and going to school and needed the car. There was no bus service to anywhere near where she kept the horse. So, she had to rely on friends and relatives to drive her out to see the horse. I drove her to and from her horse several times.

Understand the difference between the normal case of catching a ride and the situation she was in. She had to catch a ride every day. EVERY DAY. The person giving her the ride could not just drop her off and leave. You had to stick around during the full time she was there and then take her home again. This was sometimes a several hour commitment. You had to carry food for the horse and her tack because she couldn't leave it in the stall for fear of it being stolen. Those of us who had cars got tired of taking her to see the horse fairly quickly. One friend stopped driving his car over, he just rode his motorcycle. You can't carry a saddle on a motorcycle. Getting to and from the horse was a problem all the time she owned the horse.

Then there was the problem of “muck”. Young ladies who are in love with horse rarely seem to think about the back end of the horse. You feed a horse, you water it, and the back of the stall quickly fills with a mixture of straw, urine, manure that is politely referred to as “muck”. You have to muck out the stall every day. Yes, EVERY DAY. Not a problem she had planned for.

Mucking out a stall requires a strong back, a shovel, a place to put the muck, and straw to spread around on the floor of the stall. The straw helps the muck dry and stick together and keeps the back of the stall from turning into a pit as you slowly take the floor out with the muck. The need to buy straw and pay to have it delivered was another unforeseen expense.

The key thing about muck is that it is unpleasant. It was amazing the first time I watched LS grab her shovel (something she had not budgeted for) and clean out that stall. (Yes, I offered to do it once, she declined the offer.) She transferred the muck from the stall to a pile well away from the stall one shovel full at a time. She did not have a wheelbarrow. No budget for that.

It seems she had tried to dump the muck in a ditch behind the stall. Makes sense, we dump human muck in water and flush it away. She figured the water in the ditch would do the same with horse muck. Nope, it plugged the ditch, not to mention that people didn't like the idea of getting horse muck with their ditch water. So, she had to clean out the ditch.

She would go out to the stall every day, catching a ride anyway she could, ride the horse briefly, comb it and brush it, feed it and water it, clean out the muck, spread fresh straw, and then go home. Every single day. Of course, some days she had to visit the feed store too.

The killer was that the time she spent taking care of the horse was time she could not work. So, owning the horse not only had a rather large (to her) fixed cost but it reduced her income. It got to where all she was doing was working, and taking care of the horse.

She kept it up through most of the summer. One day near the end of summer I offered to drive her out to her horse. She said “oh, I sold it.” I asked her why and she said that with school starting she wouldn't be able to work enough to afford the horse. It seems that that owner of the stall had informed her that she couldn't keep the horse there in the fall or winter because it would freeze to death. The cost of a winter stall was more than she could make working full time as a babysitter. She sold the horse back to the person she bought it from, to the person who owned the stall, the same person who sold her a used saddle. She got to ride the horse everyday for a couple of months. I never heard her say another word about horse for all the years I knew her.

I always figured the guy who sold her the horse laughed all the way to the bank. She did all the chores involved in maintaining the horse. She paid for all the food for the horse for a couple of months. And then she sold it all back to him at a loss. So he actually made a profit off the deal and still had the horse.

The point though, is that she only looked at the front end of the project. How to get the money and find the horse. Trying to buy a horse forced her to look at the cost of maintaining the horse, but she never consider how owning a horse would reduce her ability to own one. Then there was all the muck. She never considered that if you feed a horse it will produce muck. That is, she never considered the on going costs or the back end of the project.

Lets all admit that we have made the same mistakes when planning a project.

How do we avoid problems like this? A long time ago I ran into a quotation that was attributed to Harry Houdini, I have not been able to find it since and so I can not claim that it is in fact from the great Houdini. The quotation goes something like this “To understand a magic trick, look at if from underneath.” The example was a case where Houdini appeared to pass through a brick wall built on stage at a theater. The trick is that the wall was built on a carpet, to protect the stage floor, that just happened to cover the trap door in the middle of the stage. The wall ran right over the trap door. Once the trap door was lowered the carpet sagged enough for someone to crawl under the wall. Then, when the trap door was raised, there was not sign of what had happened.

The trick was totally mystifying if looked at from the point of view of the audience. But, it was easily understood if looked at from underneath.

In the same way, if you want to get a better understanding of what it takes to take care of a horse, you have to look at it from the rear. You have to follow it around for a while. A rider sits on top of the horse and only looks forward and really never sees what is happening on the other end.

When planning something you have to look at it from the front, middle, back, side, and if you are lucky from a couple of other angles as well.

Jan 31, 2013

His Teachers told him he could not learn!

Have you ever held out some bright colored thing in front of a baby? It takes a moment for the baby to notice it. Then it focuses on the thing. It may seem like the baby does it one eye at a time. Then the eyes get wide, wider, so wide you think they will pop out of its head! Its mouth pops open and the baby might even start to quickly open and shuts its mouth making a soft pop, pop, plop, pop... noise and start to drool. At the same time both arms and even both legs are waiving in a seeming random pattern in the general direction of the fascinating new object!

When you remove the object from the babies view it starts to cry. If the object was truly fascinating the baby will not stop crying for several minutes or until you bring the object back into its field of view.

You might see a similar response from a teenage boy (or any human male over a certain age for that matter) when the right woman walks by.

You rarely see a response like that from a college student in class. But, when you do you know that you have witnessed a miracle. Something profound has happened inside that students mind. They have experienced an "Aha!" moment. Usually that means that two or more ideas came together in a totally unexpected way, or they have encountered a fact or idea that has forced a major change in their world view. This kind of experience can be exciting and enabling, or it can be horrifying. But, with luck when you see that look, you are seeing the birth of a self motivated, self educating mind.

You never see exactly the same reaction that the baby gives you. But, you see the same gleam in the eyes and you might see the mouth pop open. I have even seen students reach out as if to grasp the idea out of the air before it got away. (Though that gesture can be confused with an aborted attempt to raise their hand to ask a question or express an objection :-)

When you see that look you know your life has been worth living. You have passed the fire. One more person just may have become a self motivated learner. Just like that baby was before teachers started punishing it for making mistakes.

I had the strangest conversation with a student before class one day. He wasn't in my class, he just sneaked into the lab to use the machines when no one was there. My habit of coming in early messed him up. I made sure he wasn't doing anything he shouldn't be doing and then let him continue to use the machines. He was very interested in learning to program, but had been talked out of taking programming classes. So, he was teaching himself.

I asked why he wasn't taking programming if he was interested in it. He told me that he couldn't learn very well because he had a learning disorder. He said he had ADHD. I said "So what?. First off, ADHD isn't a learning disorder. I have it, and it never stopped me from learning anything." I went on to say "Yeah, it is one hell of a 'going to school' disability' because teachers make it one. But it does not keep you from learning. In fact, it can really help!"

Let me say that again: ADHD is not a learning disability, but it is one hell of a going to school disability. Teachers make it a "going to school" disability. Learning has nothing to do with being liked by teachers, or getting good grades in school. But some idiot has defined it that way and anything that makes school difficult is defined as a learning disorder. This is similar to defining drowning as a breathing disorder.

The next day his mother came in to talk to me. Since her son was eight years old she had been told that he could not learn. She had been told that because he had ADHD he could never do well in school, could never learn very much, and was basically stupid. I assured her that that was not true. In fact, just the opposite was most likely true. People with ADHD are rarely of below average intelligence and are often noted for their creativity. I said that my guess was that the way he was being treated had more to do with his ethnicity (African American) than his ADHD.

I told her that my own experience was that k-12 were torture. College got easier the farther I got into it. I understand that freshman year is often pure hell for people with ADHD, but despite just barely graduating from high school I tested out of freshman year. (Zero correlation between course grades and learning.) In graduate school most of the class work was a breeze, even though the politics nearly killed me. But, I was white and my father and grandfather were college professors.... I got very different treatment than her son did. I am also old enough to have grown up at a time when ADHD behavior was called "boys being boys" and not considered to be a disorder that required correction.

His mother looked me in the eye the way only a mother can and asked "Are you bull shitting me?"

"Ma'am, I would not dare!" I replied.

She smiled, like a tiger, took a deep breath and said "Hmph!" I was very glad I was not the target of that "Hmph!".

I looked at her son and pointed out that "He knows enough about how to use the net to research this on his own. I've watched him. Give him a few days to find some information for you. If I'm bull shitting you, you know where to find me."

I never saw her again. I saw him a couple of days later. He had found a lot of information about ADHD. He had a lot of questions about better ways to find things on the net. By the end of that semester he had educated himself and his mother about ADHD. And, he signed up for programming classes.

Learning that you can do something that you never knew you could do before, that is a powerful experience. Finding out you can do something you have been told that you can not do, that is a liberating experience. Being the one that got to "teach" that person is enough to make me feel that my time spent teaching has not been wasted.

No one ever taught anyone else anything... but sometimes, like a good trail guide, you can roll a rock off the trail that was blocking their way and point them in the direction they need to go, even down a trail they didn't know was there. And, when they get to the top of an unknown hill and look out at a land they never imagined, they just might get that look.

Dec 7, 2012

Programmers have a right to be Grumpy!

Grumpy Werewolf coffee mug (Google Affiliate Ad)
Wouldn't you know it... I've had a blog on this domain since 2009 and now I find out that some guy, OK a pretty damn good programmer, has started writing books under that tag line of the "The Grumpy Programmer's Guide ...".

Oh well, you would think he and his publisher would try to be a bit more... polite. But on the other hand, there are a hell of a lot of grumpy, and even severely pissed off, programmers in the world. We have a right to be pissed off. The trouble is that we are too damn stubborn to fix the problems.

Of course, most of the problems stem from the sad fact that only programmers actually know what is involved in writing programs. One of my favorite examples of that occurred when I was working for Evans & Sutherland in the early 90s. They had been the premier computer graphics company in the world. But, they were on their way down...

The company decided to build a graphics workstation to compete with the machines made by SGI. Seemed like a good idea at the time. So we got the first motherboards and started testing them and they were very sloooow. There was of course a lot of discussion of the problem but no one seemed to understand what was going on.

We had truly great engineering management at the time. Our VP of engineering was Gary W. Hodgman of Sutherland-Hodgman clipping algorithm fame. Best damn engineering manager I ever had the pleasure to work for. We had weekly company wide meetings to discuss everything. At the weekly meeting the performance problem was a major topic. One of the god level EEs told us that the problem was with the software. The EEs had designed a memory interface optimized for Random Access to Memory.

"Everyone knows that programs access memory in a random pattern, that's why it is called Random Access Memory. But, when we trace the actual usage pattern, almost all memory accesses are sequential! This company has the weirdest programmers in the world. You guys have messed things up so badly that we get no value form the hard work we did to support RANDOM ACCESS!" 

(Note: OK, it was long time ago and the quotation is only approximate. You might notice I only give names of people I admire. Also, my use of the term "god level" hints at a cultural problem that the company had that is what really killed it. If you had the right adviser at the right graduate school you could do no wrong at E&S. You could waste money and time and destroy one project after another and be rewarded for it. You were at the "god level". The rest of us actually had to produce working products and working code. The rest of us weren't even second class citizens compared to the god level folks.)

Oh my...  The guy really was shouting at the end. There was an initial shocked silence. I broke the silence by asking the fellow if he was aware that instructions are normally fetched sequentially from RAM. The guy next to me asked if he was aware of the memory access pattern for pushing parameters on a stack. It went on like that for a few questions and then broke into general laughter. I remember one VP, the VP of whatever he wanted to be, nearly fell off his chair. That is when the poor godling EE's face really turned red. Gary cut off discussion and ordered a special meeting for immediately after the end of the big meeting to plan corrections to the design.

The next batch of motherboards worked just fine.

The key here is that even the ultra well educated and well paid engineers who were given the job of designing a computer did not actually know anything about software. They were making their decisions based on nonsense they had picked up off of the equivalent of the bathroom wall. They never bothered to walk to the other end of the building to ask if what they "knew" was correct. These were people with graduate degrees who had specialized in the electrical engineering of computers. The only purpose of a computer is to RUN SOFTWARE. But, in all their studies of computing hardware they had not bothered to learn anything about the actual purpose of the the machines they were learning to build.

The arrogance needed to back that level of willful ignorance is astonishing. These were guys who should have known better working for management who definitely should have known better. Trained by people who had to have known better.

But, what the heck, while I have several stories about absurdly arrogant EEs for every one I have about EEs I have at least 3 about software developers. We can be just as bad, if not worse.

Just a little? post script: A couple of weeks later I was walking down the hall carrying a phillips screw driver. I was stopped by one of the chip designers involved in the motherboard fiasco who said something like "Whoa, the scariest thing in the world, a software guy with a screw driver". I told him I knew how to use a screw driver. He said "Really, hows that?". I replied "Well it depends, but based on where you're standing right now I would just swing it up to about here" indicating the notch of his rib cage "then put my other hand behind it and drive straight on through the aorta". He laughed and said I was a funny guy as he stepped back.

The conversation progressed from there and at some point he said "Hey, I hear you're a pretty good programmer, how many lines of code can you write in a year?".

I looked at him and asked "How many square inches of silicon do you layout in a year?"

He started to explain to me that, of course, chip designers were not rated that way. He explained that if they were then they would design chips that were so large that they could not be fabricated.

It was like something out of a Sutra... He got this weird look on his face and then he was enlightened.

"Ohhh....." he said, "if the only thing that mattered about a programmer was how many lines of code you could write in a year then you would all write programs that are so large that no computer could run them. I smiled and started to walk down the hall. I felt I had made a real break through in Software guy Hardware guy relations.

I got about two steps when he caught up with me and said "No, seriously, what are you doing with that screw driver?"

The Pragmatic Programmer By Hunt, Andrew/ Thomas, David (Google Affiliate Ad)