Sunday, October 31, 2010

Do Compuhters Think?

Chuck: Uhmm, you spelled compuhters wrong.
Narrator: Oh, hey, you're right. That was on purpose? Yeah, that's it, on purpose. It's ironic - talking about stupid machines by misspelling a word.

Okay, I don't buy it either. Truth is, I spelled the word wrong entirely by accident. A fortuitous accident, though. Computers are dumb as a box of rocks. Silicon makes up a quarter of the earth's crust. That qualifies as a rock. Making your computer a box of rocks.

A computer does exactly what you tell it. Nothing more, and nothing less. It makes no judgment. Never considers alternatives. And could care less that you spent 6 weeks writing this term paper. The computer will happily delete it without a second thought.

See - even I anthropomorphise the box of rocks. And I know better. The computer is not out to get you. You won't make it angry. It doesn't get revenge. The computer is a thing - like a hammer or saw. It has no intelligence.

Now, programmers can tell your computer how to do amazing things. Hundreds of millions of instructions go into the word processor so you can write a letter to Aunt Polly. So how does the machine know to put a red squiggly under spelling mistakes? Because some programmer accounted for that. A human being saw the problem, devised instructions for solving that problem, and gave those instructions to your computer.

Fear is the Path to the Dark Side

All of this to say - don't be afraid. There's nothing magical about a computer. Sure, bad things can happen when you get careless. That's why my 7 year old daughter can't use my power saw. She might lose some fingers. When she's 16 though, I can teach her the dangers.

Learn the dangers. Study what you shouldn't do. Then you're free to do everything else. Once you understand the danger, you can use this tool without fear.

The Blind Spot

Our conversation begins with this article by Mark Whitehorn. I've been there. How about you?

My first real life project - fresh out of college - converted data from a 9-track tape into the company's database program. Each record contained 1,200 fields. And every tape had all of the previously loaded data. You read that correctly. The tapes were cumulative.

I finished the project and learned a lot about file processing. Called our client, asked about delivery. He was not sure either. He said to call the data processing center. The center had no idea who my company was or how we could deliver our software. My supervisor was just as perplexed as I.

As we walked down the hall, I happened to glance at the installation schedule white board. There was my client's name - a month out. They did not even have our product yet! No wonder those poor people were confused by my questions.

Assumptions

We make assumptions about the world around us every day. You assume that gravity works. You assume that the hamburger the waitress brought for lunch is really hamburger. This is a normal and healthy part of our lives.

Remember the first rule of programming: Theory and reality never match. And its corollary: My theory's right, reality needs to be fixed. At least, that's how we behave.

Coding Standards: Do It My Way or Else

The time has come, once again, for the dreaded coding standards committee. I don't imagine this conversation - I lived it. Every other year or so someone resurrects this tradition. And then utterly fails to accomplish anything useful. Why?

Coding standards solve the wrong problem. All of those discussions about placement of braces, number of spaces to indent, and routine comments mask the underlying issue - your application is complicated! These minutiae are merely fire and motion discussions. You spend so much time focusing on the bullets whizzing overhead that you never shoot back at the enemy.

Don't believe me? Then why does some form of the standards committee meet every other year? And they discuss the very same issues again and again?

The problem is understanding. Your company drops you into another module/package/program with no training. And you spend a lot of time just learning those little intricacies that build up over the years. How do we cut the learning curve?

Coding standards won't improve understanding. How about comments? Every programmer in the world knows to comment their code. And we get beautiful gems like this:

if x then
#if condition is true
[do something]
end if

Writing good comments is very difficult. Now I'm really going off the deep end. Comments are difficult because we write schizophrenic code. In code review, the two biggest non-technical issues are readability and performance. We balance writing code for the computer versus writing code for the human maintainer. Two audiences: human and machine.

Humans and machines understand differently. Go figure, who knew. People read code differently than the computer does. Actually, people have noticed. Coding standards and comments all try to fix one common defect: a person and the computer have to understand the same thing.

Think about that for just a second. People and machines process the code in opposite ways. Yet we're trying to write code where both have optimal understanding. So we move in opposite directions, hoping to reach the farthest distance in both directions. Compromises don't work that way.

Literate programming addresses this problem by organizing code both ways. It provides a framework for writing human oriented code. Then re-arranging it for the computer. You write the program for people. And then instruct the compiler in the most efficient arrangement.

Imagine yourself writing functional specifications and then adding the code right there. Link the code directly with the specification. Seems like the best comments money can buy.

Wednesday, October 27, 2010

One Time Software

Scott: I'm having trouble with a programmer. As a programmer, he does really well. As a salesman, well, not so much.

Narrator: What do you have him selling?

Scott: He sells his time - his programming services. We consult with small and medium size businesses. My programmer sells his skills for their IT projects.

Narrator: And how do you bid these jobs?

Scott: Well, the programmer talks with the client. Then he estimates the project size. And we quote them a price.

Narrator: I see your problem. It has many causes. And one good solution: iterative programming.

When you quote an entire job, start to finish, you just pit the programmer against the client and sales people. Every project becomes a battle. The customer you so desperately want to help is your enemy. Or it feels like it, anyway.

Iterative programming gives the client control over spiraling costs. At any time, they can say enough. Because every iteration provides working software, you reach a stopping point at regular intervals. The programmer doesn't hide in a cave, running up your bill, until they have a Mona Lisa.

The programmer, on the other hand, has a definite agreement on what the client expects. You see, the client, the programmer, and everyone else involved decided what pieces work by the end of the iteration. The programmer can tweak those pieces to his heart's content. The plan focuses his effort.

This problem boils down to communication. I finally made the connection between my monthly budget and how I write software. Time is money. We follow a written plan with our money. It starts with a perfect month. In the ideal life, how would our money divide out each month?

Then we ignore it. Each month gets a budget based on what we'll actually spend. See, life never happens according to plan. Rather than force life into our shape, we plan for change. Iterative development does the same thing.

You start with an ideal plan. That plan does not reflect what actually happens. It only shows what can happen. The ideal keeps everyone grounded in reality. With a budget, it demonstrates that you live within your means. With scheduling, it means you can deliver what you promised.

Then each month - or iteration - you plan what actually happens next. This step is the key. The communication matters. You can agree on anything - as long as everyone agrees. Regardless of their role, everyone involved is a person.

Tuesday, October 26, 2010

What's in a Name

Why the whacky name - Imaginary Conversations? Well, simply, I have a vivid imagination. Topics that tickle my fancy turn over and over in my mind. An audience (of one) forms. He/she takes on a life of their own, offering counter points. Rabbit trails materialize, are followed, and come back around. This eventually morphs into a discussion of the pros and cons with my make believe foe. It's pretty sad when I lose.

Right now, I can see you sitting there, a quizzical look on your face, thinking that this guy is plain nuts. Well, yes, just a little. We just had a conversation. See - it's pretty simple.

Topics cover all kinds of diverse, unrelated fields: finances, programming, leadership, freedom, etc. You may notice some common threads underneath. Let me know what they are.

Browse, enjoy, and join the conversation...

Monday, August 30, 2010

WE'RE DEBT FREE

Baby Step 2 took our family 3 years to pay off $34,000 in debt. $75,000 if you count the house that sold when we moved. My wife, Renee, counts it.

The hardest part - when I lost my job. It delayed Baby Step 2 around 9 months. We were pretty impatient by that point.

The best part - I describe it as "our snowball hit a tree". My youngest daughter, Vania was born with digestive problems. She threw up everything she ate. 4 ounces in became 4 ounces out. Vania did not grow for her first six months.

The specialist prescribed a baby formula that absorbs faster than Vania threw up. This formula cost $580 a month. Ouch!

I did the budget with some trepidation. We had just paid off our second largest debt the month before. With that extra bit, the debt snowball reached $580 a month! Our debt snowball disappeared in one fell swoop - and it was worth every penny.

Proverbs 15:4 says the tongue that brings healing is a tree of life, but a deceitful tongue crushes the spirit. When we unwrapped the chains we had put around God's money, we found a tree of life - literally. That was the moment I realized we were winning with money.

Today, Vania is a healthy toddler running around the house, getting into everything. I smile when I remember that lesson in God's faithfulness, and how special Vania really is.

Wednesday, August 25, 2010

The Value of Grace

I recently read Atlas Shrugged by Ayne Rand. A very good book. I highly recommend it. Without giving any of the story away, the book discusses the nature of wealth. It very much favors a free market and excoriates the redistribution of wealth. That rang true.

The Bible explicitly talks about redistribution of wealth...
You shall not steal - Exodus 20:15
You shall not covet your neighbor's house. - Exodus 20:17a
"Stolen water is sweet; food eaten in secret is delicious!" But little do they know that the dead are there, that her guests are in the depths of the grave. - Proverbs 9:17-18
The words of the wicked lie in wait for blood, but the speech of the upright rescues them. - Proverbs 12:6
Okay, so the world works correctly when we trade value for value. How does salvation (grace) fit into that? Isn't the point of grace that we can't ever repay it - that we are not worthy - we have no value to trade? If giving something for nothing hurts the recipient, and God's grace does not hurt us, how can we receive it for nothing?

I first thought that maybe our obedience is payment. God expects obedience, and forgives our failures as part of His grace. A friend rightly pointed out that this would lead to the heresy of works based salvation. We definitely do NOT want to go down that road. Salvation is wholly God's work (solo gratia).

Maybe I approached the question incorrectly? I assumed that receiving something for nothing is harmful. What if the harm isn't the act? My friend explained that our obedience stems from gratitude. We obey because God gave us something of great value. The love and justice we mirror (created in His image) beget a response of gratitude. And God has made clear in His word that He wants our obedience as an expression of that gratitude.

What if someone were to remain ungrateful for God's gift? Is that even possible? Well, no. The act of salvation renews our spirit. The process of sanctification - which begins then - makes our heart more like Christ's. Jesus and the Father are one - the same. We respond with justice and love because those are attributes of God. You must respond in gratitude because of who you are - a living reflection of God's image.

Proverbs 12:10 says that "a righteous man cares for the needs of his animal, but the kindest acts of the wicked are cruel." An act is a physical thing. You do something, and everyone can see what you do. The nature of the giver and recipient are spiritual - you can't see or measure it. Their nature determines the effectiveness of a gift. A person with a wicked nature can perform kind acts that still result in harm. The spiritual result comes from the spiritual source - the nature of the giver.

So are the senators and congressmen calling for more government benefits righteous or wicked? Wise or foolish? Because their nature determines the results. Even the kindest acts of the wicked are cruel. It doesn't matter if your representative agrees with your political stance. Their nature - their character - weighs far more heavily.

Back on topic... God changes our nature. We were dead in sin. He makes us alive. He begins the process of turning our hearts more like Christ. His nature and our nature make the gift effective. God does not willy nilly throw His gift into the sea of humanity. He picks and chooses. And in so doing, makes us valuable. Let me be clear - our value comes entirely from God. He makes us valuable, and then gives us a gift because of our value to Him. Wow.