# Tuesday, April 6, 2010

There is a reason why computer languages are called "languages". These languages share many common characteristics with the languages that humans use to communicate.

Humans use languages like English, French, Mandarin Chinese, and Farsi to communicate with one another. Programmers use languages like Java, C# and Visual Basic to communicate with computers.

Human languages contain words and each word has one or more correct spelling and one or more meanings; Computer languages have keywords that have a single correct spelling and one or more correct meanings.

Human languages have a grammar to which writers and speakers are expected to adhere. Deviating from this grammar makes it more difficult to understand the message. Computer languages also have a grammar that we call "syntax". It is not sufficient to throw together correctly-spelled keywords: They must be structured properly. Some languages have stricter grammar rules than others, such as a requirement that we declare each variable before using it.

Writing quality software in a computer language is similar to writing a good book or article in a human language. It is possible to write a poorly-written book in English that has perfect spelling and grammar. Microsoft Word will report no errors when you press F7 when editing such an article, but that tells us nothing about the quality of the writing, which may still be confusing or boring. Similarly, it is possible to write slow, non-scalable, difficult-to-maintain software that violates no rules of spelling or syntax. This software will compile but will not perform well.

The main difference between human languages and computer languages is the precision required by each. We can communicate reasonably well in a human language, even if we use poor grammar and poor spelling. This is because we have other communication mechanisms to use, such as expression, tone, gestures and a shared context with others. Computers are generally not smart enough to understand us unless we are very specific in the words we use and in the way we structure those words. We must be more careful what we type and how we compose our words when communicating with a computer.

This is why I believe that writing software has improved my communication skills in general. By forcing me to choose carefully my words and grammar, I get in the habit of communicating with greater clarity.

Comments are closed.