2006/06/05

所見略同

What language would you recommend be used to teach programming to new CS students?

My language expertise is limited to C++, and I don't really know enough about the pros and cons of competing languages to make an informed evaluation. Having said that, my feeling is that a first language should foster a feeling of power and accomplishment out of the box — it should get people excited about the limitless things that can be accomplished in software. Among other things, such a language would offer an extensive and powerful library, so that complex tasks such as navigating the internet or putting up GUIs would be easily accomplished.

Candidate languages that come to mind would be Java, C#, and Python. Neither C nor C++ offers sufficiently powerful libraries to be good candidates for a first language, in my opinion. When it comes to systems programming, they're great (C++ is greater :-}), but I don't think that introducing programming through systems applications is the best approach for the majority of new students.

這是 Scott Meyers 在一次 interview 裡面對於 "first language" 所提的看法。其中很重要的是 "the majority",C/C++ 當然可以拿來教學,但對於「多數」學生而言,終日面對黑底白字的 console 操弄抽象數字,很難讓他們對 programming 產生濃厚興趣。而且,C++ 這個 multiparadigm language 想耍弄得好,要花的工夫實在不少。文內提到 Java as the first language,我認為相對於 C++ 適合一些些(因為 libraries 比 C++ 豐富易用),但整體而言還是太硬。

喔,才剛寫完這篇(的上半部)往下讀,interview 裡面的下一個問題就是:

Every language has its flaws. What are the three things you dislike most strongly in C++?

I'd like to answer this question with "complexity, complexity, complexity!", but naming the same thing three times is cheating. Still, I think that C++'s greatest weakness is complexity. For almost every rule in C++, there are exceptions, and often there are exceptions to the exceptions. For example, const objects can't be modified, unless you cast away their constness, in which case they can, unless they were originally defined to be const, in which case the attempted modifications yield undefined behavior. ...

這也支持剛剛那問題的解答 :)。

--
喔,好吧,你應該知道我在想什麼,就是 R 開頭的那傢伙嘛 :P。

<< 回到主頁