Programming Is Language

Posted by Daniel Lyons Thu, 11 Sep 2008 14:46:00 GMT

I’m here to tell you that virtually all of programming is premature optimization.
Jonathan Edwards

This morning I remembered a cool program I had seen the other day, webby. I looked at it and I was thinking, maybe I’ll replace this blog with some kind of article serving website of my own construction, without commenting or trackbacks or any of that other crap I’m not really sure I like anyway. And then it would be more like a website and less like a blog, so when I occasionally write compelling content, it might actually stay up here for a while. I have often thought I would be happier if I had an RSS feed on top of some kind of categorized pile of essays. Plus, it would encourage me to write essay content instead of blog content, like I’m doing right now.

See, I have a bit of angst about this. The next version of the blog software I’m running, Typo, does not have the realtime preview functionality. I’m not sure why they decided to remove it (it’s one of the things I love most about Typo, dammit) but if I want to keep using Textile to run my blog I’m going to have to live with a publish/edit/publish/edit cycle. I’m already doing that somewhat, to fix typos and make sure it looks good enough, but I’d rather not become more dependent on it. And of course, they’re pushing TinyMCE on me. I hate TinyMCE.

Apart from that, in writing my company’s new product website I used Coda to edit the content. And, you know, it was really nice. Coda is a very good editor for the web, and it does a lot of book-keeping for me, it’s the kind of thing one would use DreamWeaver for if DreamWeaver didn’t suck so badly (apologies to Reid, my business partner, who uses DreamWeaver).

I’m staring at webby and thinking, this would be really cool, it would convert my problem back into a text problem. A programming problem. Compile your website.

This isn’t the first time someone had this idea. John Shipman, my mentor back at school also did this by writing webstyler “to reduce the drudgery of writing and maintaining webs.”

Of course, neither technology really guarantees you’re going to be writing compelling content. But it’s a pretty sure sign that a technology will help if it makes the task more fun. As much as it sucks, Typo 5.0.2 with the preview editor makes writing more fun for me, as does Coda, and I’m really not sure that webby would. Maybe. I might give it a try anyway. Since I’m not going to get live preview in Typo 5.1.

Have you noticed programmers often seem to convert your problem, whatever your problem might be, into a text/language problem? Back in the day, writing a GUI app was a huge headache. You had to code up where to draw everything, pixel by pixel. Widgets made it better, but it wasn’t until layout editors came around that it really became pretty doable. And yet, HTML + CSS takes the world by storm, converting the problem back into a language problem. Write your UI in HTML, so much less work because you don’t have to worry about the pixels. Then we’ll just write a giant stack of code to convert that into an interface, with the pixels.

Somehow, we just can’t seem to see the work that’s being done—both the work we’re writing code to do and the work we’re doing by actually writing that code—when we introduce another linguistic barrier. Perhaps Jonathan Edwards will have his revolution and the next generation of programmers won’t be as linguistically pre-occupied. Notice how little of the editor debates actually have anything to do with the aesthetic experience of editing the code. They all talk about power and speed and slimness and other attributes, but not the way it feels or looks. Unless you’re on a Mac.

I am wondering whether or not programming and language are one. I tend to think they are because of something I was taught in college. Some problems are concrete, because they have an encoding for input and output (anything on a computer). Some problems are decision problems, because they return true or false. Any problem can be made into a concrete decision problem by rewording it to accept a problem and a candidate solution and returning true or false. And every language is essentially a concrete decision problem: is this sentence in the language, yes or no?

It’s hard for me to overemphasize the role that this concept plays in my everyday thinking. Nevertheless, I am forced to ask myself whether or not my attachment to it is more mystical than scientific. I’m not sure I benefit from this thought tangibly. In fact sometimes I think I may be enslaved to this thought. Because if it affects all of computation and computer science without enlarging or reducing the set of possibilities, it’s hard to say what I gain. Would I gain from treating every problem as a compiler problem? It would probably make me feel better about it.

Any programmable system has a grammar and is thus a language. Even if the programming system ultimately was waving a magic wand or mixing potions. You could even say that a GUI is a programming system, the language is mouse clicks and key presses. Certainly not as automateable by default. This seems to mean that any human-computer interface is interchangeable, doesn’t it? Couldn’t I say that a programming language is a user interface? It is, isn’t it? Maybe API stands for application programmer interface rather than application programming interface.

So what difference does it make if I compile me websites and you edit yours in DreamWeaver? (Hey, at least Reid uses the code view and not the design view.) The answer, from a computational perspective is that there is absolutely no difference. Because the point of CS is to abstract things away to reason about it. But there is a very big difference in reality: enjoyment.

There aren’t going to be many users of webby who are not programmers. That’s fine, if that’s their aim. But let’s keep our bias in mind as we develop systems. We are bred to be linguistic. Users aren’t.

Tags , ,  | 1 comment

Comments

  1. Avatar Bill Weiss said about 24 hours later:

    You make a good point about users vs programmers. I manage a system at work that was written in house. It’s a huge distributed database app with about 30 TB of data online. It has two interfaces:

    • A simple form where you fill in the fields with the data you want.
    • Raw SQL (on over a dozen tables with more than 10 columns each).

    The people who use this app are computer literate, but not programmers by any stretch. Guess how many complex queries they write?

    John Shipman once pointed me at Query by Example for this problem. Most of the papers about it are kind of scary and EBCDIC laden, but the concept is good.

    Sorry for taking the kind of trivial part of your post and commenting on it, but that’s what I’ve got this morning :)

(leave url/email »)

   Comment Markup Help Preview comment