Skip to main content

Computers Languages, Human Languages

One reason I am writing about learning to code Cocoa apps for OS X and iOS is that I view programming languages as specialized human languages. After all, humans do create the languages. We create computer languages with our notions of what a language should be, from its grammar to its level of abstraction.

In my post on the generations of programming languages, I mentioned that languages are interpreted, compiled, or translated, with some variations and complexity within those processes.

Let's consider how these compare to the human language process.

Compiled Languages

About as close to the "natural" machine code as many programmers get on a regular basis, compiled languages remind me of our "native" spoken and written languages. After a while, we think our silent thoughts in a human language. We are entirely unaware of how our brain converts (or compiles) the language into neurological pulses. For me, English seems to be the language of my brain — even though it isn't.

Or brains might be called "just-in-time" (JIT) compilers. They are fast, but there is still a lag between thought and action — or action and thought!

Interpreted Languages

Interpreters work in "real-time" with some overhead. The interpreter, a specialized program, translates each line of human-readable programming code into machine code. This is similar to having a sign-language interpreter standing beside a public speaker. A good interpreter is fast — keeping up with the speaker, with only a slight lag. But, there are some challenges.

The interpreter has to know both languages well. That requires a fair amount of memory. The interpreter also has to know the oddities, the quirks, of the two languages. Most interpreters cannot match the power of a compiled language — but they are more than sufficient for many tasks.

Translators

When you translate one computer language into another, and then compile the results, you end up with acceptable machine code. I compare this to translating literature. Imagine wanting to share Dante's Devine Comedy with a literature class. Instead of reading the Italian with an interpreter repeating the lines in English, it makes more sense to translate the original. But, the translation is never perfect.

When you translate a program from BASIC or Fortran to C, a common task with "Business BASIC" and free Fortran compilers, the resulting C code is not as efficient as programs written directly in C. Translating software simply applies rules and patterns to the process. When we speak, we don't always communicate the same idea with the same words. The words change, based on context. But, a translator does not appreciate nuances within a language. Words and phrases are translated with a rigid formalness.

If you speak more than one language, you might recognize that people also learn second languages in a formalized manner. I know a bit of Spanish. When I speak Spanish, I still include the pronouns that a native speaker omits over time. My Spanish is more "wordy" than a native speaker's Spanish. Yes, it is correct, but it is also inefficient.

As I'll write in future posts, learning to program is learning additional human languages. At first, you translate ideas. The code you write works, but it lacks "native" elegance. In time, you master a language and adopt the common idioms. You learn what to omit and why.

Hopefully, others find this comparison useful and come to appreciate why I value teaching programming to more students.

Comments

Popular posts from this blog

Comic Sans Is (Generally) Lousy: Letters and Reading Challenges

Specimen of the typeface Comic Sans. (Photo credit: Wikipedia) Personally, I support everyone being able to type and read in whatever typefaces individuals prefer. If you like Comic Sans, then change the font while you type or read online content. If you like Helvetica, use that.

The digital world is not print. You can change typefaces. You can change their sizes. You can change colors. There is no reason to argue over what you use to type or to read as long as I can use typefaces that I like.

Now, as a design researcher? I'll tell you that type matters a lot to both the biological act of reading and the psychological act of constructing meaning. Statistically, there are "better" and "worse" type for conveying messages. There are also typefaces that are more legible and more readable. Sometimes, legibility does not help readability, either, as a type with overly distinct letters (legibility) can hinder word shapes and decoding (readability).

One of the co…

Let’s Make a Movie: Digital Filmmaking on a Budget

Film camera collection. (Photo credit: Wikipedia) Visalia Direct: Virtual Valley
June 5, 2015 Deadline
July 2015 Issue

Every weekend a small group of filmmakers I know make at least one three-minute movie and share the short film on their YouTube channel, 3X7 Films.

Inspired by the 48-Hour Film Project (48hourfilm.com), my colleagues started to joke about entering a 48-hour contest each month. Someone suggested that it might be possible to make a three-minute movie every week. Soon, 3X7 Films was launched as a Facebook group and members started to assemble teams to make movies.

The 48-Hour Film Project, also known as 48HFP, launched in 2001 by Mark Ruppert. He convinced some colleagues in Washington, D.C., that they could make a movie in 48 hours. The idea became a friendly competition. Fifteen years later, 48HFP is an international phenomenon, with competitions in cities around the world. Regional winners compete in national and international festivals.

On a Friday night, teams gathe…

Edutainment: Move Beyond Entertaining, to Learning

A drawing made in Tux Paint using various brushes and the Paint tool. (Photo credit: Wikipedia) Visalia Direct: Virtual Valley
November 2, 2015 Deadline
December 2015 Issue

Randomly clicking on letters, the young boy I was watching play an educational game “won” each level. He paid no attention to the letters themselves. His focus was on the dancing aliens at the end of each alphabet invasion.

Situations like this occur in classrooms and homes every day. Technology appeals to parents, politicians and some educators as a path towards more effective teaching. We often bring technology into our schools and homes, imagining the latest gadgets and software will magically transfer skills and information to our children.

This school year, I left teaching business communications to return to my doctoral specialty in education, technology and language development. As a board member of an autism-related charity, I speak to groups on how technology both helps and hinders special education. Busin…