第0章:WTL之父Nenad S tefanovic访谈录[转自c-view]
http://www.c-view.org/journal
WTL之父Nenad Stefanovic访谈录
作者 采访:myan翻译:cber
介绍
每一个,正在使用C++或者准备使用C++的朋友都应该仔细的读
正文
WTL之父Nenad Stefanovic访谈录
采访:myan,翻译:cber
myan引介
作为现代C++最重要的特色技术,template正在各个传统
这个隐隐的痛处,就是在GUI编程领域。
现有的大部分成熟GUI框架和工具库,其定型时间都在90年代早
以至于是专有还是开源都说不清楚的Qt,它们在其他方面有着诸多
难道模板技术真的在GUI领域无用武之地吗?
WTL给出了一个响亮的回答。
WTL是微软ATL开发组成员Nenad Stefanovic先生在ATL
Windowing机制上发展起来的一整套GUI框架
oriented与template达成了精致的融合)
Stefanovic先生,进行了一次网上的访谈
【C++ View】:I think most of our readers are not very familiar with you,
so would you please tell us your story here? We are very fond of that.
What do you think about China and Chinese people?
【C++ View】:我想,可能我们的读者中有很多人对您还不是很熟悉
【Nenad】: I am a software developer at Microsoft. Your readers will
probably know me as a creator of Windows Template Library, WTL. I am
from former Yugoslavia, where I finished school and started working on
software development. I've been living in US for 10 years now.
I am intrigued and impressed by the Chinese culture and tradition. I
think that China is now in a great position of progress as a country
and a nation. I discovered that, being from former Yugoslavia, I
already know many things about China, and getting to know people from
China gave me a bit of the "everyday" life perspective as well. I'd
like to learn more, so I hope to visit China one day.
【Nenad】:好的。我现在在Microsoft工作
Template Library
(WTL)的创作者。我来自于前南斯拉夫,在那我完成了我的学业
中国的文化以及传统给我留下了极为深刻的印象,我对此十分感兴趣
【C++ View】:When and why did you first think about WTL? What's its
original purpose? How do you see its future?
【C++ View】:您是什么时候开始想起要开发WTL呢?为什么
【Nenad】:WTL was born while I was working on ATL (Active Template
Library). We were extending ATL to support ActiveX controls, and I was
working on the windowing support. I started thinking that the same
techniques can be applied to much broader windowing support, for the
much richer UI for controls, components, and also applications. So,
WTL was created as a part of ATL that would extend ATL to support any
kind of UI related component or application. It did not ship with ATL
in Visual Studio, however, so I decided to ship it as a standalone
library that extends ATL.
I think that WTL will continue to be a great option for developers
writing Windows applications and components. I don't see big changes
or additions to WTL, because one of the design principles for WTL was
to follow the Win32 UI API and design. It will continue to do so.
【Nenad】:WTL是我在从事ATL (Active Template
Library)开发工作时的产物。那时我们正在扩展ATL
control,而我负责的就是其中对于窗口机制部分的支持
Studio中被发布,于是我就决定将它作为一个单独的ATL扩
我认为WTL将一直是那些在Windows下开发应用程序以及组
UI的API及其设计"。现在如此,将来还是会如此下去。
【C++ View】:I first heard about WTL in July, 2000. At that time, I
thought: "No official support, no documentation, no commercial hype,
it will die in 6 months." Now, fifteen months passed, it spreads wider
and be more vigorous. Lots of C++ programmers, esp. the ones we regard
them as "gurus and masters" involved in WTL. I know it's surely
because WTL is a wonderful library, but it must be more than a
wonderful library to gain such attentions without official force.What
do you think WTL's relative success? What's the reason?
【C++ View】:我第一次接触WTL是在2000年7月。在那时
【Nenad】: I think that the main reason of WTL's success is that it did
fit the need of developers at the right time. More and more developers
started using ATL, and it was natural for them to start using WTL when
they needed more UI support. It seems that WTL was perceived as a more
open project than others, judging by the support provided by other
parties in the development community. Many people did a wonderful job
of creating samples, documentation and support for WTL. The support
from the programming community is very important part of the
acceptance and success of WTL.
【Nenad】:我认为WTL成功的最主要原因就是
从其他的开发团队所提供支持来看,WTL看起来似乎要比其他的项
【C++ View】:What do you think about MFC? Do you like it? If you don't,
why? And the most confusing thing is Managed C++, is it C++? Do the
leaders of MC++ really think some C++ users will go to learn it? Do
you believe?
【C++ View】:请问您对于MFC是怎么看的?您喜欢它吗?如果不
C++了,它是不是C++呢?MC++的提倡者是不是真的认为会
【Nenad】: I think that MFC is a great framework library. Don't forget
that MFC was designed at the time that C++ compiler was rather
limited, and the main platform was 16-bit Windows. Unfortunately,
because MFC was designed as a framework, it was really hard to evolve
it to use better C++ support in newer compilers, and to add support
for new features added to Windows in the meantime. What I don't like
about MFC is the DLL approach, which causes many compatibility
problems, and framework design, which dictates too many things about
app design.
Managed C++ is an extension to C++ which allows C++ programs to use
managed code. It is very important to understand that you can compile
your existing C++ code using MC++ without any changes. MC++ allows
developers to use both familiar non-managed C++ and managed code in
the same module. That provides an excellent way to extend existing
code to interact with managed code, as well to create new projects
that can use both managed and traditional C++.
【Nenad】:我认为MFC是一个了不起的框架库。请不要忘了
Managed C++是C++的一个扩展,它允许C++程序得以使用受管
【C++ View】:In the past 15 years or more, C and C++ is the base of
almost all Microsoft's technologies(OS, COM, etc.). We C++ user paid a
lot of hard work to catch them, because we felt what we paid was
worthy(?). Now, it seems the climate changed. .NET is coming, the
world is going to be full of CLRs and/or JVMs. There has been a
decampment from C++. So what do you think about the future of C++ (not
MC++) in Mircosoft technologies? Will it go away? Will it become a
marginal language?
【C++ View】:在过去的15年中(甚至更长的一段时间内)
(Common Language Runtime,公共语言运行库)以及/或JVM (Java Virtual
Machine,Java虚拟机)。现在C++已经出现了退潮的
【Nenad】:Well, the world is changing too. The new type of development
for Web services and connected applications is on the horizon. I think
that new languages, like Java, C#, and VB.NET, were developed to
address two main issues - to simplify software development and to
provide better support for Internet development. Simplifying software
development allows more developers to write good applications and cuts
down on time needed to finish a project. Supporting Internet
development is obviously very important in this time when Internet is
used more and more in every part of everyday life.
I think that C++ will continue to be an important language, especially
for ISV's and for system development. On the other hand, I believe
that .NET will be very important platform soon. .NET has the potential
to be the main programming platform for the future, but it is
reasonable to expect that the transition will take some time.
【Nenad】:是的,世界也已经发生了变化。对于网络服务以及
我认为C++会继续作为一门重要的编程语言发挥作用
【C++ View】:There a lots of beginners in our readers, after they learn
(standard) C++, they want to seek a path to master enought Microsoft
technologies to be practical and proficient programmers. Could you
recommend such a path? Should they learn Win32 API programming? Is it
worthy of studying MFC? Is WTL/ATL/STL a reliable solution? Or goto C#
directly? Many many people will thank you if you give them frank
advice.
【C++ View】:我们的读者中有很多是初学者,在他们学习完(标准
API编程?学习MFC是否是值得的?WTL/ATL
【Nenad】:I think that depends on their plans and ambitions. The more of
those things you do, the better you are off in the long run. But, you
also have to balance that with the practical issues. So, I think that
people who see their future in the Internet development can go
directly to C# or VB.NET, and study .NET platform. Those who would
like to have more knowledge of the Windows platform and services it
provides should certainly learn more about Win32 API and libraries
that support Windows programming.
【Nenad】:我认为这主要取决于他们的计划以及雄心
API以及那些支持Windows编程的库相关的知识。
【C++ View】:Soon after I began to learn WTL, a warm-hearted man posted
me a email. He wrote: "You won't be a good WTL programmer if not a
good ATL programmer, you won't be a good ATL programmer if not a COM
programmer. And once you decide to learn COM, you are beginning your
travel to hell." Is COM so difficult to learn? How to study WTL? We
must learn API, COM, ATL and WTL in sequence, do we? And what about
COM, will it remain to be the core technology of Microsoft, or just be
substituted by .NET and dismiss?
【C++ View】:在我刚开始学习WTL后不久,有一位热心人给我发了
【Nenad】:I don't think it is necessary to master COM to use and
understand WTL. Win32 UI knowledge is more important than COM to
understand WTL. But it is true that knowledge of ATL is required, and
ATL mainly supports COM. So, COM knowledge is desirable, but not
required.
I don't think that COM is hell, but it sure does require a lot to
learn to be an expert. Keep in mind that many people don't have to be
COM experts to use COM, or to use WTL. Just understanding basic
principles of COM is enough to use it, and then people can learn more
when needed.
【Nenad】:我不认为使用和理解WTL就一定要掌握COM
UI的知识对于理解WTL显得更为重要。但毫无疑问的是
我也不认为COM是一个噩梦,但毫无疑问的是,想要成为一个CO
【C++ View】:What do you think about Generic Programming? Is it a whole
different paradigm from OOP, or just OOP's supplemental facility? Can
we combine GP and OOP? In the hard work of design and implement WTL,
you must had got an insight about the relationship between OOP and GP,
what's it?
【C++ View】:请问您对于泛型程序设计是如何看待的
【Nenad】:Generic Programming and OOP are very different, mostly because
Generic Programming doesn't explicitly express relationships between
design elements. They can, however, be used together very efficiently.
WTL uses a combination of Generic Programming and OOP design.
Templates are mostly used to implement traditional OOP classes. I'd
like to point out that WTL doesn't use any "pure" design, and it
doesn't strictly follow any design guidelines or styles. I do think,
though, that WTL does use one of the main strengths of the C++
language - it uses appropriate paradigm that is the most suitable for
a particular problem.
【Nenad】:GP和OOP非常不同,这主要是由于GP从不显
WTL中使用了一种GP连同OOP的设计。我在其中大量使用了模
【C++ View】:Recently, the famous C++ pioneer Stanley Lippman joined
Microsoft and became a member of Visual C++.NET group. How do you
think about this? What message do you think your company like to pass
to public? Does this mean Microsoft want to make VC.NET a
full-standardized C++ compiler and hold C++ as your core system
language?
【C++ View】:最近,著名的C++元老级大师Stanley
Lippman加入了Microsoft并成为其VC
【Nenad】:I think that shows that Microsoft is committed to advance the
C++ compiler and language, and ready to get the best people to help. I
am sure that VC++.NET will continue to be powerful tool for developing
applications, and that it will also include additional capabilities
for the .NET development. Compliance with the C++ Standard is an
ongoing work, and we will see further improvements there, too.
【Nenad】:我认为这显示了Microsoft对于促进C+
【C++ View】:I'm learning WTL and ATL, since you are the author of WTL
and a member of ATL group, can you give me some advice?
【C++ View】:我现在正在学习WTL以及ATL,既然您是WTL的
【Nenad】:There are several areas of programming that are very important
for WTL and ATL: knowledge of the C++ language in general,
understanding of templates, COM for ATL, and Windows UI programming
for WTL. Solid knowledge in these areas is very beneficial for WTL and
ATL developers, and it also helps to understand the source code for
both libraries.
I would also like to encourage everybody to write programs. That is
the best way to learn how to use any library, or a programming
language or operating system. Writing programs often brings problems
that must be solved that are not addressed in books. Reading about
something is very useful to start learning, writing programs is the
best next step.
【Nenad】:对于WTL和ATL来说,有好几个编程方面的领
UI编程(对WTL而言)。在这些领域有着坚实的基础对于WTL
我同样也很乐意去鼓励大家多写程序。这也是学习如何使用一个程序
【C++ View】:They say we are in the gate of Post-PC times, it will be a
embedded world, and there will be embedded smart device everywhere,
and the embedded industry will build a far large market compare to
PC's. Do you believe it? Do you think WTL and other C++ template
libraries are available and appropriate for embedded development? Are
there available for Internet development?
【C++ View】:有人说,我们现在已经处于后PC时代的门口
【Nenad】:Yes, I think that large number of various devices that we use
everyday will become small, specialized computers. That doesn't mean
that the number and importance of PCs will go down, just that there
are many other devices that will be enhanced to be programmable and
connected. Those new devices will provide a great opportunity for
software developers, because they will all have software and somebody
has to write it.
Many of the C++ libraries are quite appropriate for embedded
development, and WTL would also be in cases where Windows based user
interface is important (for example, Pocket PC platform). Great
flexibility and small footprint are always very important features for
embedded development, so template libraries are in the very good
position there.
【Nenad】:是的,我认为我们现今所使用的各种设备中的大部
有许多的C++函数库都可用于嵌入系统的开发,WTL也将会在那
PC平台上面开发)占有一席之地。对于嵌入式开发来说
【C++ View】:In the past 7 years or more, COM is Microsoft's core
technology. And we now can see that in the next decade, the core role
may be .NET. My question is, what's wrong with COM? Where will COM be?
Will it disappear? Will it be substituted by something else? What's
the relationship between COM and .NET? Is .NET based on COM? Is it
worthy of learning COM now?
【C++ View】:在过去的7年(甚至更长的一段时间)内
【Nenad】:Maybe you shouldn't ask what is wrong with COM, but just think
of .NET as the evolution of COM. .NET extends what was started with
COM- creating reusable binary components - and brings additional
important features: rich metadata, great run-time, built-in security,
versioning, etc. All of these new features are important for
development today, and it is really great that .NET has extensive
support for them. Interoperability between .NET and COM is also
provided, so that the previously developed COM components can still be
used in the .NET environment.
I still think that it is a good idea to learn COM - it is a great
first step even for people who want to learn .NET, and it also
provides better understanding of the design and implementation of .NET
itself.
【Nenad】:或许你不应该问COM有什么过错,而是应该把
我仍然认为学习COM是一个很好的主意——它甚至对于那些希望学
.NET本身的设计和实现。
【C++ View】:I know you must be a C++ fan. Now the language is facing
lots of challenges. To counterattack, Dr. Stroustrup suggest to
develop many useful libraries, and teach the programmers to use C++ as
a high level language. Now there are several wonderful modern C++
libraries. Aside of ATL, WTL and STL, there are still Boost library,
MTL, ACE/TAO, DTL, etc. It seems the C++ community is preparing a
movement. Do you think the movement will success? Why? What are your
colleagues'(in Microsoft VC.NET group) attitude towards such a
movement?
【C++ View】:我猜想您肯定是一个C++爱好者。现在这门语言面对
【Nenad】:C++ is a great language and its importance remains high, even
with the new challenges. Libraries are an excellent addition to the
language itself, as they provide very useful reusable code for
developers. The existence of many great C++ libraries shows the size
and strength of the C++ community. I think that is already a success,
and that it will continue. You can be sure that the VC++.NET group is
aware of the existing libraries, and I expect them to continue to
enhance the support for them.
【Nenad】:C++是一门伟大的语言,即便遇到了新的挑战
【C++ View】:The last question. Since lots of people don't acquaint
themselves with WTL, now we have a chance for you, the father of WTL,
to introduce WTL in a short speech here. What would you like to speak?
【C++ View】:最后一个问题。既然许多人并不了解WTL
【Nenad】:WTL is a template based library for user interface
development. It extends ATL to provide classes for implementing user
interface for applications, components, and controls. It provides
classes for various user interface elements: top-level windows, MDI,
standard and common controls, common dialogs, property sheets and
pages, GDI objects, UI updating, scrollable windows, splitter windows,
command bars, etc.
WTL is implemented using the same template architecture as ATL, so it
is a natural fit for ATL developers. It also doesn't alter or hide
Windows specific constructs, thus allowing Windows programmers to use
WTL without surprises. The important design goal of WTL was to avoid
inter-dependencies - classes themselves do not reference other WTL
classes. That means that your program will contain just the code that
you actually use, and nothing else. Coupled with the use of templates,
this allows creation of very small programs without run-time
dependencies.
WTL delivers the object oriented way to program for the Windows user
interface, while keeping the code size small. It also provides a great
foundation that developers can extend with their own classes.
And finally - WTL was written with a hope that developers will enjoy
using it. I hope you will use it and enjoy it, too.
WTL是一个基于模板的、专为开发用户界面的程序库
WTL的实现使用了和ATL一样的模板架构,所以对于ATL开发
WTL专注于用面向对象的方法来编写Windows的用户界面程
最后,我在编写WTL时就希望开发者能够喜欢在开发中使用它
正文完