Programming Methodology 2

まずは、Mehran Sahami先生の講義を視聴してみることにしました。一回目はイントロダクションだったので、二回目を全編を通して見てみました。

「Karel」というロボットか何かが街の中を歩くプログラムを作りながら、プログラミングの基本的なことを伝える講義のようです。今回は、メソッドとは何か、どんな時にfor文/if文/while文を使うのか、ということが話題になっていました。話すスピードが速くて、なかなか全てを理解することはできていませんが、プログラムはコンピュータが読むのではなく、人間が読めるように書かなければならない、という言葉が印象的でした。(講義のスクリプトも掲載されていたので、その部分を引用しておきます。)

So what we're doing is we're breaking the program down into more and more steps, and notice this is reading like English. And the important thing to realize in programming is programming is not just about writing a program that the computer understands. Programming is about writing programs that people understand. I can't stress that enough. That's huge. That's what programming style is all about. It's what good software engineering is all about.

Okay, so write programs for people to read, not just for computers to read. Both of them need to be able to read it, but it's far more important that a person reads it and understands it, and that the computer still executes it correctly. But that's the first major software engineering principle to think about.

講義中に質問した生徒に対してお菓子を投げる姿がかなりツボにはまりました。お菓子が目的ではないのでしょうが、生徒が積極的に質問する雰囲気も興味深く感じました。