Archive

Posts Tagged ‘linguistics’

You can write COBOL in any language…

January 21st, 2009

Though languages are supposed to be a tool for expressing ourselves, their capabilities seem to also shape what we express.

One commonly held belief is that it doesn’t matter what language you learn first. Whether we are talking English vs. Spanish or Java vs. Scheme, there seems to be a fairly common opinion that “the ends justify the means;” programming languages are Turing-complete and natural languages are merely a conduit for expressing what every human can express. “The only difference is in what concepts the language makes easy,” it is said. However, notwithstanding practical concerns (this is not going to be a practical post in the sense of “them’s the ropes: learn English or C# or whatever for business reasons”), I would go so far as to say that our first language is very important in shaping how we think and approach expression.

If you’re reading this blog, you know I served a mission for my church in Russia, and as such had the opportunity to learn a second language with a reasonable degree of fluency. Additionally, I got to do this at a time in my life when I was already an adult, and could note with some interest particular peculiarities in differences of expression. Some things “are merely different”–for example, a lack of articles [the, a, an] doesn’t seem to hamper understandability, given the proper modifiers. “I see cat here.” “I see orange cat of which you speak.” Funny-sounding, perhaps, but understandable. What’s significant, however, is not that it’s understandable–not that it’s merely an alternate form of expressing the same concept. What strikes me is how difficult it is for Russians to properly use English articles. Here is a case of the difference between “acceptable fluency” and true fluency. It’s a separation, as it were, between brute-force means-justified ends, and intuitive comprehension of a concept.

Should Russians feel short-changed that they didn’t get this intuition “for free”? Perhaps. But by the same token, Russian is full of things that are definitely not intuitive for English-speakers, and which in turn provide entirely different dimensions of expression–flexible word order and particles come to mind. Sorry English, but Russian poetry kicks yours’ butt. Which brings me to my next point: it would be awesome if we could pick which natural language to use for specific tasks that were suited for it.

We’ve actually seen examples of this in history — Italian is the universal language for music (though it can be argued that this is arbitrary. It has seemed to work well, though). Certainly most treaties are written in French (because they maintain stricter control over changes to the semantics of the language), and most men would use it for their sweet nothings if they could. I’m from California, which has a large population of people who have grown up with both English and Spanish simultaneously, and consequently switch between both languages in casual conversation with others like them–they pick the most convenient one for the thought (which might be only part of a sentence), and do so automatically.

However, we aren’t all free to do this. Indeed, it can be argued that even in my last example, such people are often sacrificing some degree of fluency in one language or the other. With natural languages, it just plain comes down to us not having any choice, most of the time. We didn’t choose where we were born, most high schools don’t even offer Russian, and there is no guarantee that the people you want to communicate with have made the same investment as you. Alas, being able to tailor our spoken language to the situation will likely never be a reality, but it does not change that the language we were raised with has, to one degree or another, shaped how we think.

I find programming languages fascinating. Many of the principles of natural languages apply, yet the scale is small enough that one can become “fluent” in multiple programming languages without investing years conversing with others who know it (though if you think about it, that can be helpful) or becoming immersed in another culture (though often it seems like you are). Additionally, programming languages are designed from the ground up, which tends to make them more uniform and consistent to a given purpose than natural languages, which grow out of a hodgepodge of history and intermingling. (It is interesting to note, however, that in a similar manner, many programming languages borrow from other programming languages, and some languages indeed develop quite haphazardly, organically, arbitrarily, and often stupidly… I’m looking at you, PHP.)

The biggest difference I’d like to point out is that you have the choice of which programming languages to learn, and especially which to learn first. I find it quite unfortunate that people tend to make this choice somewhat blindly (though they often think they are being pragmatic about it). This is a sensitive subject for programmers, especially ones who look at their craft primarily or solely as a way to put food on the table. To them, their language defines them, because it defines what jobs they can apply for. Without their language, they are without their job. Thus, they are going to press forward and try to ensure that they remain marketable by doing what they can to make their language marketable. Similarly, some find any, even temporary, decrease in perceived output unacceptable. These are the people who are still reaching for their mouse to correct a mistake made 3 lines previous, and who didn’t in fact notice their mistake at all until their IDE informed them of it after they clicked the little “go” button. Such people certainly aren’t going to learn a new language, no matter how much better it is, and when their language of choice adds new features, they bitch and moan.

These are all valid human emotions, and valid ways to approach programming. Certainly, much has been accomplished by programmers who work from 9 to 5 and don’t think about code again till after coffee the next morning. Programming is a valid profession, and it does make pretty good money. Indeed, it is even a safe profession–if you learn PHP or Java, you will always be able to get a job (at least until the industry changes–but hey, that’s never happened… right?). Besides, once you’ve learned one language, is just a matter of learning the syntax of a new one if you have to, right?

I contend that it is not. In the same way that I still can’t use particles correctly in Russian after living there for over two years, our first language–and by this I mean the first language really learned in depth–shapes how we think. We won’t use new, more powerful constructs if we don’t think to use them–it just never occurs to us. Or if you can’t find a spot for a new concept from the perspective of your current way of doing things, you won’t think to incorporate it. You’ll do it the old way. You may even modify company policy to make the new way illegal or discouraged–because you know how change is! Always bringing those temporary decreases in efficiency! Learning stuff, humbug! And it is easy to staunchly defend your decision; you can’t be swayed when you have no sense of comparison.

Certainly, I ran across this often in my attempts to share with others why religion is a quintessential part of my life. They don’t agree because they haven’t tried it, and they won’t try it because they don’t agree. Though certainly less important to the soul, the same thing happens in the world of programming.

A Java programmer has no idea what concise code looks like: Java doesn’t let you write it. You say “concise” to them, and they can only think “incomplete” or “cryptic”–because certainly you can code in those ways in Java, and just as certainly it’s not a good idea to do so. A PHP programmer has no concept of “ugly code,” because all of his code is ugly–the language is just that way. The C++ programmer does not know what “cruft” means. The Visual Basic programmer… well, even the aforementioned programmers pick on him. In fact, they all pick on each other, constantly and vitriolically. Why such bickering? For all of the reasons of the previous paragraphs: when Language A is your bread and butter, damn straight Language B shouldn’t exist.

And as I said earlier, people tend to rush into learning programming, and indeed you can’t blame them. How are they to know any differently? Just like politics, you are going to choose, as a new programmer, whatever people you look up to choose. Or, you let your pressing need completely govern your choice–I have to make my web page tell you when you typed something wrong, or I have to make a Windows form, or I have to add functionality to my Wordpress blog, or I have to use a Mac, or whatever. (You programmers reading this will know which language fits the stereotypical mold for each of those tasks.) Remember what everybody says! “Languages don’t differ in what they can do, only in what they make easy.” That’s fine and great, until you’ve gotten quite proficient in that language doing the tasks it makes easy, and then you run into tasks that would be better “suited” to other languages. But by that time, there’s an investment, and after all, it would take longer to learn Language B than to just figure out an acceptable way to do it in Language A, right? Gee, it’d be nice to have a program that runs on my (or my client’s) OS natively, but I know PHP… hmm… well, I’ll just make it web-based.

On the other end of the spectrum, some languages get so pigeonholed into a niche that nobody considers them for what they are. Javascript is a fine example. Sure, it ain’t perfect, but it’s actually nicer than a lot of popular languages out there. But nope, it’s for Wendy Webdesigner to piddle around in when she wants to make a button clear the form fields on her web page. (Yes, “Web 2.0″ has changed this slightly, but it’s just a different stereotype: now it’s for making cool fadey effects!) However, not even Javascript suffers the scorn of the truly unconsidered languages–the so-called “academic” ones. Lisp? Haskell? Perish the thought!

Ugh, sorry. I’ve gotten way too soapboxy–to the point where I’m fortunate that no strangers read this blog, or I’d be getting hate mail from apologists everywhere. (And yes, all the apologists make more money than me.) My point, if you can remember my point, is that our pragmatism is affecting us more than we know. Programming is a field where you can literally always be learning, and where better ways to do things will forever be invented. Often these better ways will involve effort on our part if we want to harness them–new paradigms that we must tackle intellectually. It’s not just learning new syntax. And the relative difficulty of adapting is indeed affected by what we have learned previously.

I know I’ve been overly sardonic in this article because programming is my hobby as well as my profession, and programming languages as means of expression and problem-solving are of particular interest to me. But I do genuinely believe that aside from personal interest, these things have an impact on what kind of programmer you are and what kind of programmer you become. I don’t think it’s unreasonable to assume that a programmer who has learned new languages as part of helping him develop new ways of thinking–to obtain new tools to deal with various problems–might have some advantage over one who learned Language A because there are a lot of jobs for Language A.

It is my hope that some employers will consider this, and instead of just looking for Language A programmers because your competitor does, perhaps considering Language B. Or C. (Haha! C joke.) Likewise, I would hope that some Language A programmers would take the opportunity to broaden their horizons personally–chances are, it will even make you a better Language A Programmer. And it’s fun! I promise. And to aspiring programmers: it’s worthwhile to invest some time researching before polishing the {curly-braces} on your keyboard. Seek out a polyglot–we’d love to offer some advice.

Misinformed Ranting , , ,