$\newcommand{\defeq}{\mathrel{\mathop:}=}$

## 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.

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. ...

--