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

Digital Writing Ideas

Online composition and participation are always a requirement in the courses I teach. When I began teaching at Fresno State as a graduate student in 2004, I was one of the few instructors who required students use Blackboard on a weekly basis. I believe there are several reasons to use tools like Blackboard / WebVista: Students can read and respond to the thoughts of their classmates. I have a record of how writing (and thinking) improve during a semester Peer editing can occur online, in small groups. Students less vocal in class discussions tend to participate more online. Normally, I post a " Weekly Response Question/Topic " based on class discussions during the week. Students can then extend the in-class discussion online. Those who were unable to speak up during the class have time to reflect and post their thoughts, too. By requiring every student to post at least 50 to 100 words a week, they soon engage each other in discussion. I always use threaded discussions...

Human Readers for Tests

As readers of my blogs know, I'm never opposed to using technology when it is an effective tool. I am opposed to the blind embrace of the latest trends without critical examination of the potential side effects. Computer-assisted grading, I can endorse to some extent because I use software to help me analyze student papers — and my own writings. But, I cannot and will not endorse any system that gives weight to the computer-based scoring. If you're a teacher, consider this petition: http://humanreaders.org/petition/index.php Now, I also want to add a critical comment on human graders. If the graders of standardized tests are using rigid scoring rubrics, they are little better than software algorithms. Bad grading is bad grading. Inflexible = bad. Again, I am not opposed to using a computer for fact checking, some plagiarism verification, and as formatting aids. Computers can and do help many of us write more effectively. But, I don't use computers to grade pape...

Podcasts and Internet Radio

You must read Podcasting News if you are interested in podcasts! The New York Times has NYTimes Podcasts covering almost every area of interest. For anyone and everyone, podcast.net is a directory of professional and amateur podcasts. Unfortunately, many podcasts come and go too quickly and the directory links to some ghost sites. For October 30, 2007, we were instructed: In your blog: listen to some podcasts and analyze different aspects of the production quality of these podcasts; then, reflect on ways that you could use writing to create podcasts or coursecasts; brainstorm some ideas for creating your own podcast: an interview, presentation... I am a fan of Internet Radio, podcasting, and pretty much all things resembling "radio" in any form. For November 6, we have been asked to create a podcast of some form, and I certainly don't see a problem creating a theatrical production of some sort. Podcasting has the convenience that most Web tools lack. A podcast ...