2006/09/05

Dijkstra & C++

首先是 D.E. Knuth 在下面所提的那篇訪談裡提到自己和 E.W. Dijkstra 對於 C++ 的看法:

DDJ: I understand you are not entirely a partisan of the C++ language.

DK: C++ has a lot of good features, but it has a lot of dirty corners. If you don’t mind those, and you stick to stuff that can be counted well-portable, it’s just fine. There are many constructions that are ambiguous, there’s no way to parse them and decide what they mean, that you can’t trust the compiler to do. For example, you use the “less-than” and “greater-than” signs not only to mean less-than and greater-than but also in templates. There are lots of little things like this, and many things in the implementation, that you can’t be sure the compiler will do anything reasonable with.

Languages keep evolving, and that’s necessary. I find it impossible to write books for archival without resorting to the English language, though. Whatever computer language is in fashion, you can guarantee that within a decade or two it will be completely out of fashion. In my books, I try to write things that aren’t trendy, but are things that are going to be worth remembering for other generations. I’m trying to distill what, in my best judgment, out of thousands and thousands of things that are coming out now, is most deserving to be remembered.

DDJ: You’ve mentioned Edsgar Dijkstra. What do you think of his work?

DK: His great strength is that he is uncompromising. It would make him physically ill to think of programming in C++.

然後是 E.W. Dijkstra 在《The Humble Programmer》對 languages 的看法:

Another lesson we should have learned from the recent past is that the development of "richer" or "more powerful" programming languages was a mistake in the sense that these baroque monstrosities, these conglomerations of idiosyncrasies, are really unmanageable, both mechanically and mentally. I see a great future for very systematic and very modest programming languages. When I say "modest," I mean that, for instance, not only ALGOL 60's "for clause," but even FORTRAN's "DO loop" may find themselves thrown out as being too baroque.

當然,那時候連 C 都還沒出現,Dijkstra 也不可能直接批評 C++ 了。如果連 for loop 這種規模的構件都會被評為 "too baroque",龐大的 C++ 應該難逃批評吧 XD。Ruby 這種 syntatic sugar 一堆的大概也難逃大劫 XD。

--
即使沒看過 Dijkstra 直接批評 C++,以 Knuth 與 Dijkstra 的關係,前者講的話應該不會差太遠 XD。

Blogger yen39/05/2006 1:41 pm 說:

loop竟然是synatactic sugar,我好佩服那時代的人....

 
Blogger yen39/05/2006 1:54 pm 說:

真正看懂之後,物是人非啊,什麼事都在改變呢

 

<< 回到主頁