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

Practical Technology Skills

This blog is a revision to a column I wrote for Direct Media publications. Normally, I wouldn't repost something I wrote for hire, and I certainly don't wish to anger one of my publishers. However, since this blog is primarily accessed by one of my graduate seminars, I think the publisher will appreciate that I am extending my thoughts for educational purposes. I'm also more than willing to encourage businesses to visit the Direct Media home page . Page numbers seemed to be a half-inch lower on each successive page. I stared at the mid-term paper, handed in to me by a junior at the university, and thought back to my fights with dot-matrix printers. When I was an undergrad, my Epson FX/80 printer jammed often and would sometimes rip pages after the sprockets slipped out of alignment with the punched holes of the perforated paper. Surely the undergraduate author of this paper suffered the curse of a similarly possessed printer, I told myself. “I guess when I changed the ma...

Pursuing a University Degree Online

Visalia Direct: Virtual Valley February 2008 Issue January 7, 2008 Pursuing a University Degree Online When a star high school student graduates in Tulare County, the difficult reality is that he or she most likely will leave to attend a four-year university. For an eighteen-year-old student, leaving the Central Valley, or at least Tulare County, is part of the educational experience. But, after returning to Visalia some of us find out that our undergraduate educations are not quite enough. For those in education, Fresno State, Fresno Pacific University, Chapman University, and others have offered courses in Visalia for a number of years. This makes it possible to work and still complete a teaching credential or an advanced education-related degree. I have been thankful for the options we have in the Central Valley. But, as others have learned, if you are interested in some fields you must commute to Fresno — or even further. With the drive to Fresno taking just under an hour...

MarsEdit and Blogging

MarsEdit (Photo credit: Wikipedia ) Mailing posts to blogs, a practice I adopted in 2005, allows a blogger like me to store copies of draft posts within email. If Blogger , WordPress, or the blogging platform of the moment crashes or for some other reason eats my posts, at least I have the original drafts of most entries. I find having such a nicely organized archive convenient — much easier than remembering to archive posts from Blogger or WordPress to my computer. With this post, I am testing MarsEdit from Red Sweater Software based on recent reviews, including an overview on 9to5Mac . Composing posts an email offers a fast way to prepare draft blogs, but the email does not always work well if you want to include basic formatting, images, and links to online resources. Submitting to Blogger via Apple Mail often produced complex HTML with unnecessary font and paragraph formatting styles. Problems with rich text led me to convert blog entries to plaintext in Apple Mail ...