Kids language and programming language

In my lingusitics class, the professor contrasted two different forms of the same meaning:

    I went to the store.
    I bought some peanut butter.
    I took it home.
    I made a sandwitch.


    When I went to the store, I bought some peanut butter, which I took home to make a sandwitch.

And it struck me that the former is a lot like imperative languages, while the latter is a lot like functional languages. Well, I’d say the latter is more like well-written Perl. Functional languages look more like:

    I made a sandwitch with the peanut butter I bought when I went to the store.

And it really reflects the characteristics of these various paradigms. The imperative and Perl are approximately as understandable as each other, but the Perl is smoother to read (I am speaking about well-written Perl here). The functional is the most concise but it takes some deciphering. The most interesting thing is that these are all valid constructs in English, and each type is used in moderation to achieve the most elegant prose. What I’m basically saying is that if you believe programming languages are like natural languages, then Perl’s philosophy is dead-on in that you take a little bit from every paradigm in order to achieve the best program.

1 thought on “Kids language and programming language

  1. Whereas, this is how I program:

    I went to the sandwich, and used peanut butter to buy the store.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s