On teaching programming languages

Via this tweet I came across this insightful comment over at Slashdot.  Quoting in its entirety:

A bit off topic, but you triggered something I’ve been thinking about for a couple of years. That “spark” is fluency.

I swtiched jobs from being a computer programmer to being an ESL teacher in Japan. Japan is somewhat famous for churning out students who know a lot *about* English, but can’t order a drink at Mac Donald’s. We used to have a name for those kinds of people with regard to programming languages: language laywers. They can answer any question you put to them *about* a programming language, but couldn’t program to save their life. These people often make it past job interviews easily, but then turn out to be huge disappointments when they actually get down to work. I’ve read a lot about this problem, but the more I look at it, the more I realise that these disabled programmers are just like my students. They have a vocabulary of 5000 words, know every grammar rule in the book but just can’t speak.

My current theory is that programming is quite literally writing. The vast majority of programming is not conceptually difficult (contrary to what a lot of people would have you believe). We only make it difficult because we suck at writing. The vast majority of programmers aren’t fluent, and don’t even have a desire to be fluent. They don’t read other people’s code. They don’t recognise or use idioms. They don’t think *in the programming language*. Most code sucks because we have the fluency equivalent of 3 year olds trying to write a novel. And so our programs are needlessly complex.

Those programmers with a “spark” are programmers who have an innate talent for the language. Or they are people who have read and read and read code. Or both. We teach programming wrong. We teach it the way Japanese teachers have been teaching English. We teach about programming and expect that students will spontaneously learn to write from this collection of facts.

In language acquisition there is a hypothesis called the “Input Hypothesis”. It states that *all* language acquisition comes from “comprehensible input”. That is, if you hear or read language that you can understand based on what you already know and from context, you will acquire it. Explanation does not help you acquire language. I believe the same is true of programming. We should be immersing students in good code. We should be burying them in idiom after idiom after idiom, allowing them to acquire the ability to program without explanation.

I’ve been thinking about this for a long time as well.  And I do agree.  I also think that programming is a very practical matter. As the comment says, one could know everything about programming in general and some programming language in particular, and yet be totally useless when it comes to writing code.

I think, when it comes to getting an online IT degree or a degree from a traditional school that most colleges and universities lack on the practical side when teaching programming.  At most I’ve seen done were short group assignments.  I think programming projects should be much larger and longer than that.   I don’t see anything wrong with having a couple of programming assignments spanning a couple of years.  Bachelor degree takes longer than that, and all that time could be used to teach students not only how to write code, but also how maintain it, how to document, how to work in groups, how to use all those tools that programmers in real world are using – IDEs, debuggers, compilers, version control, project build tools, continuous integration systems, and so on and so forth.  All of those won’t do any good (and possibly quite the opposite) on a tiny little short assignment.

On free education

Cyprus Updates points to several studies, one of which indicates how much money people in Cyprus spend on compensating the poor quality of public education.

In Cyprus, tutoring consumed €111.2 million in 2008, of which €30.5 million was for children in primary schools, and €80.7 million was for students in secondary schools.

For me, it reminds and aligns with many of those things Sir Ken Robinson discusses in his talks.  The world is changing very fast and education system should keep up with these changes.

[youtube=http://www.youtube.com/watch?v=zDZFcDGpL4U]

 

Wikipedia on common misconceptions

It is way too easy to get lost on Wikipedia.  Pages upon pages upon pages of information, with links to each other and to outside resources make time stop.  But once in a while one can stumble across a page that conveniently collects numerous bits of knowledge and wisdom in a lengthy item list.  Today I saw just such a page – List of common misconceptions.

Some of those misconceptions are well popularized by now.  Some I’ve seen before by accident (for example, “MythBusters” show on Discovery channel takes care of some).  Some are not at all important to me.  But some really surprised and shocked me.  After reading through the whole list, here are those that were new and surprising to me:

  • It is a common misconception among Americans that the signing of the Declaration of Independence occurred on July 4, 1776. The official signing occurred on August 2, 1776.  Never knew.
  • Napoleon Bonaparte (pictured) was not especially short. 1.68 meters.  I thought he was indeed short.
  • There is no evidence that Vikings wore horns on their helmets. This is the biggest shock to me.  No, really.
  • In ancient Rome, there was no wide-spread practice of self-induced vomiting after meals, and Romans did not build rooms called vomitoria in which to purge themselves after a meal. Vomitoria were tunnels underneath the seats of a stadium, through which crowds entered and exited.  I’ve heard this too many times and never heard anything of the opposite.  So I assumed it was true.  Better check next time.
  • Entrapment law in the United States does not require police officers to identify themselves as police in the case of a sting or other undercover work.  Every time I saw it in the movies, I thought it was stupid nonsense.  Turns out I was right.
  • When a meteor lands on Earth (after which it is termed a meteorite), it is not usually hot. In fact, many are found with frost on them.  Never knew.
  • It is a common misconception that seasons are caused by the Earth being closer to the Sun in the summer than in the winter. In fact, the Earth is actually farther from the Sun when it is summer in the Northern Hemisphere. Seasons are the result of the Earth being tilted on its axis by 23.5 degrees.  They taught me this misconception at school.  Back when I used to believe my teachers.  Damn it.
  • People do not use only ten percent of their brains.  I never believed this anyway.  Good to know I was right.
  • There is also no evidence that reading in dim light or sitting close to a television causes vision to deteriorate.  Again, I am surprised I was right.  Never ever did I believe this for a second.  And I had proof of my perfect vision.
  • Prolonged exposure to cold weather such as rain or winter conditions does not increase the likelihood of catching a cold.  I kept saying this for years.  Every time people looked at me like I am an idiot. I’m not denying that I am an idiot, but give me a break with the looks when I say at least something that is true.
  • Although it is commonly believed that most body heat is lost through a person’s head, this is not correct. The head loses as much heat as any other part of the body.  I was told this so many times that I almost believed.  Good thing I had my own data for not wearing a hat at -25C.
  • Humans have more than five senses. I always knew that we have more. I just was not smart enough to think of examples.  Thank you, Wikipedia.
  • Bulls are not enraged by the color red, used in capes by professional matadors. Cattle are red-green color-blind. It is not the color of the cape that angers the bull, but rather the movement of the fabric that irritates the bull and incites it to charge. This is new to me. And shocking.  I’ve seen an angry bull once.  I should have been more worried about my movements than my cloths.  I’m glad I survived to learn this.

Have you been surprised by any of the misconceptions in that page?

Scholar

– How’s school?

– Too early in the morning and too boring.

– Too early, eh?

– Yes, I want to sleep.  (classes start at 7:30am)

– Son, welcome to the adult life.  Everyone wants to sleep here.

– Really?

– Yes.  So, what was so boring about school?

– It’s not like kindergarten.  We have to sit, listen, and keep quiet.  We only have breaks to play.

– Well, that’s another thing about being adult.  You have to do much more boring stuff than before.

– Adult life sucks and it is confusing. (I am paraphrasing here)

– Yes, it does and yes, it is.

Maxim is now a first grader at Logos School of English Education.