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 Linux and Android relationship

Linux Weekly News did an excellent coverage of James Bottomley talk at LinuxCon Japan on Linux and Android relationship.  I’ve read several opinions on the matter and this one seems to be the most balanced and objective.  There is something to learn here for every open source developer and enthusiast.

The community should do better at fostering and embracing diversity, encouraging forks (which can create significant progress) and helping them to merge back. Currently, James said, the kernel gets a “C – must do better” grade at best here. We only take code from people who look like us; as a result, the Android merge attempt was more painful than it needed to be.

Companies, in turn, should aim for “control by acclamation” rather than control by total ownership. Linus Torvalds was given as an example; he has a lot of control, but only because the community trusts him to do the right thing. In general, if the community trusts you, it will happily hand over a lot of control; that’s why the benevolent dictator model is as common as it is. On the other hand, companies which try to assert control through walled garden development or by demanding copyright assignment from contributors have a much harder time with the community.

In summary, James said, Android was a fiasco for everybody involved; we all need to figure out how to do better. We need to find better ways of encouraging and managing forks and allaying licensing fears. Projects which create forks should be thinking about merging back from the outset. Then projects which (like Android) are a commercial success can also be a community success.

Searching for Larry King

The other day I was having an argument about interviewers.  Of course, I had to mention Larry King, who’s name escaped me at the time.  For some reason, my tired brain was suggesting Stephen King, who is obviously a totally other person.  Google will tell you everything there is to know about a man, if you give it a name.  But how do you search for a person’s name when you don’t remember it?  Gladly, Larry King was easy to find.  A search for “interviewer glasses suspenders” answered my question in seconds.

Fedora 16 will use Btrfs as default filesystem

Linux Weekly News notifies:

At the June 8 meeting of the Fedora engineering steering committee (FESCo), the group decided that Fedora 16 will ship with Btrfs as its default filesystem. Btrfs is a relatively new copy-on-write filesystem with many interesting features such as read-only and writeable snapshots, multiple device support for RAID, online filesystem defragmentation, and more, though it is still marked as experimental in the kernel. “AGREED: Feature is approved. Will add some base critera to the page to be met by feature freeze. This is just a swap of ext4 to btrfs for default, not change of lvm or other parts of default.

As noted in the comments, Btrfs is marked as an experimental feature in the kernel.  As also noted in the comments, many other features which were marked as experimental were brought into production and that seemed to work fine.

While I personally have no knowledge of Btrfs stability or readiness for production, I am slightly worried by that move.  First of all, ext4 – current default filesystem – works fine for me and for everyone I know.  Why fixing something that works? It seems that Btrfs is a better choice for server platforms.  And while Fedora is mostly used on the desktop, it is still a testing platform for Red Hat distribution which is, in fact, a server-oriented line of products.

On another note, Fedora 15 upgrade was a bumpy ride. Again, not just for me, but for everyone I know.  Switch to Gnome3, sysctl, and other changes didn’t quite work out of the box for many people.  Btrfs might do the same.  I think it’s better to push such a change at least to Fedora 17.  Let people recover slightly.  Focus instead on fixing things which are broken.  Let people regain confidence in Fedora distribution and its upgrade paths.  Please.

China is coming

These days, when discussing globalization with my friends, the discussion often touches upon China.  And more often than not I hear skepticism when suggesting that China’s role is becoming more important and more influential.  While I am of the opinion that China is in its early stages of being a global superpower, many people seem to believe that China has some sort of limitation that it won’t ever overcome.  The mass production of cheap, low quality goods seems to be the sky’s limit.  I strongly disagree with that.  I’ve read and heard plenty about the quality of Chinese production going up.  And I don’t believe that China is limited by cheap labor alone.

Today, I read an article in GigaOm about Chinese geeks, who have studied and worked in US.  Many of them, it seems, are going home to start business in China.  Here is a quote form the article:

In China, the red-hot tech scene seems dominated by a small group of entrepreneurs who paid their dues in Silicon Valley before returning home to create successful Internet and software startups. Aside from finding fame and fortune, these “returnees” are also laying the foundation for a startup culture that will allow grassroots entrepreneurs to flourish as well.

Returnees — Chinese nationals who studied or worked the U.S. — head up just 3 percent of all tech companies in China, yet they represent nearly 70 percent of all startups that go public in the U.S. market (still the largest measure of success in the industry), according to an internal study by Palo Alto, Calif.-based venture capital firm GSR Ventures, which deals exclusively in China. The firm also found startups created by returnees were much likelier to become financially successful and hire more employees than startups founded by Chinese entrepreneurs who never worked in the U.S.

On the same note, I’ve heard similar things about India too.  You don’t have to know too much about Indians in technology – look at some conference presentations from Google, Yahoo or Microsoft.  Half of the people speaking will be of Indian decent. And one day some of them will go back to India to start their own business too.  Still think that China and India will serve the world with cheap labor  and call centers for the eternity?