Programming as Language.

Language as programming?

> “Just use the keyboard!”
> Star Trek 4: The Voyage Home

When a newbie programmer repeats a bit of code three times hoping that the effect will catch — as is common when trying to grab carriage returns and newlines with getch() in C… I’d like to argue that it’s not that they are dumb, but are simply using the wrong model to interact with compilers and unaware of the underlying systems at play.

I see this odd repetition habit as a side effect of human language being a noisy distributed system. As children, we learn how to communicate clearly — often repeating ourselves if the person we’re talking to doesn’t seem to understand. Even great authors use something similar in writing where they emphasize a point three times. 

There might even be some science behind this:

> “It seems too simplistic that just repeating a persuasive message should increase its effect, but…”

Learning developers want to make sure the action is communicated clearly. Given their past experiences, when they encounter an intuitive error, they think the computer is not listening (paying attention?).

We lean on what we already know when learning new things, trying to find similarities between them. This leads to the often unspoken and unintentional assumptions the novice programmer makes. They have yet to develop a stronger model of how code works.

Of course, someone who’s familiar with the way compilers work would see the failure is that they’ve yet to fully model how the computer operates — it’s usually a misunderstanding of hidden primitives; a similar failure can be seen in the nature of white-space characters. Wouldn’t it be neat if code compilers were distributed and performed a sort of lazy-evaluation?

When I code I run a compiler in my mind to see how the computer would understand it. Now with my writing, i’m trying to do the same thing. in a similar vein. I’ve been including powerful quotes as a way to shift emotional stance — and i’m literally imagininging it as changing memory banks that the user is pulling from. I think it’s a powerful lens and so far it’s helped me quite a bit.

A lot of my older writing felt the same way. Trick I’ve been using to frame it is to think about it like defining variables at the top of the document. At least metaphorically so. When I think of an audience I’m actually imagining a bunch of variables already predefined. Sort of like assuming they have include file they imbed when they go to interpret it

Programming as Language