Code Head
I’ve got a bad case of “code head” at the moment. We’ve been working non-stop on our prototype for the last week, and after spending all that time in deep conversation with my computer I find it hard to communicate with ordinary people.
It’s hard to describe what programming feels like to someone who’s never written code. My best analogy is that it’s like trying to give instructions to your annoying kid brother, who happens to be a bit forgetful, somewhat hard of hearing, and very lazy. A typical conversation might go something like this:
You: Hey computer, I’d like you to add something for me.
Computer: Add what? I can’t add just anything.
You: I’d like you to add a number.
Computer: What number?
You: Five.
Computer: What about five?
You: Add five to something.
Computer: What do you mean something? What kind of something?
You: Add five to another number.
Computer: Which number?
You: Any number. It doesn’t matter. I’m creating a routine.
Computer: Oh. I see. You’ll want a variable, then.
You: Yeah, a variable. So I want you to add five to this variable–
Computer: Can we give it a name? I don’t remember things very well unless they have names.
You: Oh, OK. Call it
x.Computer: Call what
x?You: Call the variable
x.Computer: What kind of variable is it?
You: It’s a number. We’re going to add five to it.
Computer: Is it a big number?
You: [confused] I don’t know… No. No, it’s a small number, OK?
Computer: Does it have decimal points in it?
You: What does it matter?
Computer: I’m curious.
You: [slowly] No, it’s a very small number without decimal points. It’s an integer, OK?
Computer: What is?
You: The variable. The variable is an integer.
Computer: Which variable?
You: The one we were talking about before:
x.Computer: What about
x?You: [frustrated] Look, the variable called
xis an integer, OK?Computer: Oh, right. Gotcha.
You: OK, now I want you to add five to it.
Computer: Add five to what?
You: Add five to
x.Computer: You didn’t say, “Please.”
You: [angry] What? Why you little…
Computer: And I’m doing this in my own language, so you have to use “semicolon” for “please”.
You: [resigned] All right. Fine. Have it your way. Here you go:
5 + x;Computer: OK.
You: Now if
xis20, what’s the answer?Computer: What answer?
You: The answer to the question I asked!
Computer: Oh, you’ll want another variable for that.
You: Huh? Oh, fine… call the answer
y. And before you ask, the variableyis an integer, too.Computer: OK.
You: So, I’ve got an integer called
x, which in this case happens to be20.Computer: OK.
You: Now add five to
x.Computer: OK.
You: Now what’s the value of
y?Computer: Zero.
You: [incredulous] What?
Computer: You didn’t assign a value to it.
You: I want
yto be the answer!Computer: The answer to what?
You: [exasperated] Look,
y = 5 + x;OK? Have you got that?Computer: Yes.
You: And in this case
xis 20, which makesy…Computer:
25.
This is the sort of dialog that occurs between the computer and the programmer all the time. Getting into the appropriate mindset to deal with a computer requires a lot of concentration. Programmers call this a state of flow, or being in the zone, where the programmer is able to think like a computer does, so that the conversation above never happens and instead the programmer just types the lines:
AddSomething()
{
int x, y;
x = 20;
y = 5 + x;
return y;
}
Sometimes it’s just as hard to get your mind out of a state of flow as well. That’s part of what makes working at a small software startup like infovark challenging. We have to toggle between pedantic, logical computer mode and natural, relativistic human mode. In one minute we can be thinking about strategic marketing campaigns and the next about how to explain to our idiot kid brother exactly how to do the next step in the task without him messing it up again.
In a way, it’s this frustration that drove Gordon and I to start infovark. We’ve seen far too much software that passes the frustration of being a programmer on to the end user, forcing non-programmers to go through painful, time-wasting conversations like the one above. Right now, we’re going through the tedious process of telling the computer exactly what should be done when so that our customers can get on with the important things in life.
Ben Tremblay said,
Wrote on February 5, 2008 @ 9:43 pm
Know what?
That’s my secret the tech_docs.
Point of tech_docs isn’t for me to understand the sytem.
Though I need to understand the system to write good tech_docs.
But engineers’ tech_docs are very much for them to understand.
Or, more precisely, so that they remember what they’re doing.
It isn’t likely that they’ll forget what they’re trying to do, though that happens, sometimes.
Far more likely that they’ll forget what they’re doing. I mean actually doing. I mean right now at this moment along with when we made that decision yesterday afternoon.
Is why their tech_docs please themselves so often, and please me so rarely. Which pleases them not at all.
When their tech_docs reflect what they’re doing, they can use that to see when they’re wrong.
When they’re doing something wrong, and their tech_docs reflect that, and they don’t realize it, that’s when they’ve forgotten what they were trying to do.
Which is when I step in.
Which is when they get pissed off.
Which is when I table the tech_docs I got them to write.
Which pleases them not at all.
But at least they see the disconnect.
Which is what I’m there to do.
I’m not an engineer.
But I can see there’s something amiss when yesterday Engineer A said F[l,m,n]=42 and today he’s saying it 7X10E20 (Which, BTW, is our latest estimate on the number of star-like bodies in the heavens.)
It’s not about pleasing engineers.
Or writing pleasant fiction.
It’s about saying what’s so in any moment.
Which is invariably 42.
As it should be.
==30==
The Address Bar as the New Command Line « Infovark Underground said,
Wrote on April 1, 2008 @ 1:21 pm
[...] Why do we care about making things easier on our silicon-based friends? Well, one reason is that it indirectly makes things easier on those of us humans that give instructions to computers. (As a programmer myself, that’s a big selling point.) Another reason is that if it’s easy enough for a computer to figure out, then it ought to be brain-dead simple for a human to understand. As I’ve pointed out before, computers just aren’t very bright. [...]
noah said,
Wrote on April 25, 2008 @ 3:46 am
I totally agree with you it is really like that.