posted by Matt Ward on Mar 9, 2010.
In this second article on the relationship between human languages and coding for the web, I will consider issues of linguistic evolution, language families, syntax and the way all of these things relate to coding for the web. I will also make a bold suggestion about your ability to code, even if you’ve never written a single line in your life!
That was the first of a two part series on language and coding. This article is part two.
The specific direction of this article is a little less focused. Though I will ultimately come to a final conclusion, I would mostly like to consider coding as it relates to human (or “natural”) languages in several areas. First, I would like to look at the evolution of language, and the way different languages can be grouped into families. Then, I will consider the importance of syntax and grammar and the linguistic base of every coding language that I know of.
This will, admittedly, be a somewhat general discussion, but I think and hope that you may find it interesting.
The Evolution of Language
Human languages do not exist in a vacuum. Nor have any of them simply sprung out of nothingness fully formed and ready to be written or spoken by the masses. Instead, languages change and evolve. Often, they even collide, creating hybrid dialects which may go on to become new languages all on their own.
Take English, for example. Though I am simplifying somewhat, English began as the language of the Anglo-Saxons who invaded the British Isles in the late 5th century. It was primarily Germanic in origin, and eventually evolved into what is known today as Old English, which very few of today’s English speaking people could read without extensive study.
Later, English would be transformed again by contact with the Norse, and through the Norman conquest, which would infuse the language with a great deal of French-influenced words. As such, the language that we have today actually has several linguistic ancestors, and is related to other languages like French and (to a lesser extent) German.
Coding languages are much the same. HTML was developed from an older language markup language called SGML, which was in turn a standardized version of an older language called GML. In turn, HTML has also been extended in multiple versions (including the new HTML 5) and into XHTML.
All in the Family
In a sense then, we can think of each of the four different types of coding languages that we looked at in the previous post as language families, within which the specific languages are all related to each other in some way. There are even some relations between families. PHP is a good example of this. While, at its core, it is a procedural programing language, it is also designed to integrate with blocks of HTML code, making it an ideal for serving up dynamically generated web pages.
To continue with our linguistic metaphors, it’s kind of like learning a sister language to one that you already know. Both French and Spanish ultimately derived from Latin, and I have often heard that if you know one, learning the other is relatively easy. While I don’t know very much Spanish, I did take one Latin class at university, and found that my fluency in French really helped. Most of the other students in the class were Classics majors (I was in the English program), and had little training in French (other than the high school classes that all Canadian students are required to take). Because I had been speaking French since I was six years old, though, I seemed to pick up the ancient Roman language more quickly, because I could relate it back to a something that I already knew.
When the semester was over, I decided that Latin was not something that I really wanted to pursue, but still ended up with one of the highest marks in the class. If it had not been for my background in French, though, I’m not sure that I would have been quite so successful.
Of course, this is especially true of different languages within the same basic family. If you learn the basic concepts of programming – defining variables, defining conditional statements, writing custom functions and such – what you learn can be generally applied from one programming language to another, from C to PHP, and even to Basic-based languages like Visual Basic. The key differences are found mostly in the names of various commands and functions, and (often slight) variations in basic syntax.
Syntax and Grammar
Syntax is important too, and the concept comes directly from the field of linguistics itself, where syntax is used to describe the formation of sentences – either written or spoken. At its most basic level, then, syntax is about word order, punctuation and the other rules of grammar, and varies from language to language.
A simple example is the difference between the use of adjectives in English and French. In English, adjectives almost always precede nouns, as in the example:
The large, red tree…
In French, however, it is common to see adjectives come after the noun as in
Le grand arbre rouge…
If we were to try to use the exact same French syntax in English, the sentence would read:
The large tree red…
And that’s a sentence that even Yoda wouldn’t use. So, as you can see, syntax is important for conveying meaning in language.
It is doubly so with coding. Computers are very powerful when it comes to processing raw data, but they’re really not all that smart. While bad grammar can make something difficult to read, in most cases the human mind is smart enough to be able to fill in the gaps and actually figure out what is being said. Again, Yoda is a prime example. The Jedi master might say something like:
Changes nothing this does.
This is not a proper sentence in English, but most people who hear (or read) it will be able to translate the sentence and understand that it is actually saying:
This changes nothing.
var myName = “Matt”;
This command will be understood and executed by the interpreter. However, something like this will throw an error:
Variable myName is Matt.
As humans, we are able to recognize that these two commands are saying pretty much the same thing, but when it comes to coding “pretty much” might as well be “completely wrong”. The computer is expecting very specific commands that follow very specific rules. Any deviation from those rules will inevitably cause problems.
Fortunately, the syntax for coding languages tends to be far simpler than the grammar for a spoken language like English. There are typically a few simple rules for structuring your code, most of which are usually fairly simple to learn. There are few (if any) exceptions to these rules, too, unlike English which has at least a dozen ways of breaking any given grammatical rule.
This makes learning a coding language much simpler than learning another spoken language. In fact, I would like to suggest that anyone who can read and write can (with some commitment) also learn to code!
In truth, all “coding” is simply writing a series of instructions or schematics to be interpreted by the computer. If you can write basic instructions in English, or describe the various elements of a given object, I am confident that you would also be able to write code. All you need to do is learn the language and its syntax.
Based on English
The same is also true of HTML, with tags like <title>, <blockquote> and <cite>, or for CSS properties like background-position, line-height or font-weight, which literally describe the properties that they control
The Masters… and the Rest of Us
Of course, while I do believe anyone who can write can also code, I don’t necessarily believe that everyone can really master the art. The vast majority of people in Western countries can read and write. In my opinion, far fewer can actually write well, and only a very rare few are what I would call masters of the language – those individuals who can weave their words with such poise and beauty as to be able to truly affect the hearts of their readers.
I think the same thing is true of coding. While I believe that any designer can develop into a competent coder, I don’t necessarily think that all of these people will necessarily be good coders. Moreover, only a very few will ever become the type of truly great coder who is capable the pure creativity and innovation that truly moves the internet forward.
Those coders are the Shakespeares, Hemingways and Hardys of this great digital playground we call the World Wide Web. Many of us designers and developers look up to them, perhaps with the hope of one day achieving a similar status. Until then, the rest of us can just keep learning and pushing forward, and getting a little better with every single day.
What are your thoughts? How do you relate the concepts of language and coding for the web? I’d love to hear your thoughts on this, so please feel free to leave a comment!Post A Comment
Also from Echo Enduring Media: