Thursday, March 10, 2011

The Art of Computer Programming: Programming Languages

Today I'm bringing you the second installment in an ongoing series intended to demystify the practice of computer programming. Last time, I wrote about the utility of a good text editor to a programmer. Though relatively useless to the average person, a good text editor is indispensable for a developer. Why do programmers need such a good text editor? Most of a developer's day is consumed by writing source code in a particular programming language, and the ability to do so painlessly and efficiently can have a huge impact on productivity. This brings me to today's topic--programming languages.

Java is one of the most commonly used languages today

"Programming languages" share half their name with "natural languages." Indeed, the two are fundamentally in the same business, that is, communicating information between two parties in a mutually understandable form. In the case of programming languages, the two parties are not humans, but rather a human and a computer. When one needs to communicate with a friend from overseas, one learns a foreign language. Similarly, when a programmer wishes to convey information to a computer, he or she learns a programming language. (A minor difference exists in that programmers usually regale computers with mind-numbingly repetitive instructions rather than study-abroad stories.)

You might be wondering why we need programming lanugages in the first place. Why can't we just describe what we want the computer to do in English? Natural languages are imprecise, which is a problem in critical situations. The same sentence can have multiple meanings depending on interpretation, not to mention inflection, body language, and other context. As we saw on Jeopardy a few weeks ago, the state of the art in natural language processing is not nearly capable of handling nuanced requests. Watson confused Toronto for a US city which is relatively harmless. What if Watson confused your bank account for someone else's or thought you wanted to send email to Margaret your paramour rather than Margaret your boss?

We've established the need for programming languages, so the next logical step is putting our heads together and coming up with one perfect method of communicating with machines--if only. Wikipedia lists somewhere between several hundred and a thousand programming languages. Granted, most of these languages have long been extinct, but a dizzying array of languages are still in common use. The reason for this technological Tower of Babel is the diversity of applications for programming languages. For example, PHP, Python, and Ruby are considered "internet" languages because they include a lot of features that enhance the process of web development. C and C++ are languages that are used when a programmer needs to optimize a program for speed. Java is a mainstay in the corporate and mobile spheres due to its security and the ability for programs written in the language to be run on a wide range of different computers. Still other languages, such as ML, are considered academic languages and are used more for study than application. (Yes, the high frequency trading firm, Jane Street, uses a variant of ML, but no this does not qualify as wide non-academic use.)

Learning a programming language can be a fun and intellectually stimulating experience. The most important part is resisting the urge to throw up your hands in the first five minutes and say, "This is impossible." If you had had the option, you probably would have done the same thing when you were learning English. Plenty of languages offer a gentle introduction to programming. For instance, Javascript is already installed on your computer and can be run in your browser without downloading any new software. If you get brave enough, Google a tutorial and give it a shot.

No comments:

Post a Comment