Stroustrup 在TCPL中用了三章的篇幅来讨论Design Using C++,其中的24.2专门讨论Design and Programming Language。在那一节中,他把软件设计和编程语言的关系生动的比喻为桥梁设计和造桥材料的关系。我在此摘录一段:
So what can a programming language do for a designer? It can provide features that allow the fundamental notions of the design to be represented directly in the programming language. This eases the implementation, makes it easier to maintain the correspondence between the design and the implematation, enables better communication between designers and implementers, and allows better tools to be built to support both designers and implementers.
另外还想问两个与语言以及软件工程有关的问题(在FAQ里没找到):
1. What do you like the idea of having programming lanaguage to solve some software engineering issues? Actually, many languages (including C++) are already doing it in some extend. My question is should it to be expended?
2. People normally use certain language (such as UML) to do software analysis and/or design, should a programming language to be exteded to cover them as well?
hehe, I also like Ian Joyner's views, he is also a great guy. Maybe I myself will ask BS about something of them. But from the faq and interviews of BS before, he doesn't like someone saying something bad to C++, including Ian. See below:
C++ View:Ian Joyner在C++??: A Critique of C++ and Programming and Language Trends of the 1990s一书中比较了C++和Java并批评了C++的许多机制。你赞成他的观点吗?尤其是多数新语言都有垃圾收集机制,C++中会加入吗?
In the book C++??: A Critique of C++ and Programming and Language Trends of the 1990s, Ian Joyner compared C++ to Java and Eiffel and criticized many mechanisms of C++. Do you agree with him? Especially, most new languages has a garbage collection mechanism. Will it be added to C++?
Bjarne Stroustrup:Ian Joyner对C++的观点,我不敢苟同。撇开这点,垃圾收集可能算是有价值的技术,不过并不是万能丹,它也会带来问题。对C++而言,自动垃圾收集是一个有效的实作技术,有许多为C++设计的不错的垃圾收集器(商业支持和免费的都有),而且也被广泛地使用(参看我的C++页面上的链接)。然而C++中垃圾收集机制应该是可选的,这样在不适合垃圾收集的地方,如严格的实时应用程序,可以免受其累。关于垃圾收集,我的The C++ Programming Language一书和我的主页上都用评注,可以参看。
No. I don't agree with Ian Joyner about C++. Independently of that, garbage collection can be a valuable technique, but it is not a panacea and it can also cause problems. Automatic garbage collection is a valid implementation technique for C++. Good garbage collectors exist for C++ (both commercially supported and free) and are widely used (see links on my C++ page). However, garbage collection is optional in C++ so that applications for which GC is unsuitable, such as hard real time applications, aren't burdened by it. See my comments about GC in "The C++ Programming Language (3rd Edition)" and on my home pages.
do_do, I remember that you can find answer from the faq and interviews for your question 2, so I will not ask this question to BS.
question 3 is great, I'll think and ask it to him.
楼主,请代问下面的问题:
1. In Ian Joyner's "Object Unencapsulated", he compared C++, JAVA, and EIFFEL from OO point of view. Can you give us a general comment on it?
2. If you get a chance to redo C++ from scratch, what will you do differently?
3. Has OO delivered? If there is a language to replace C++, what do you think it will be?