这些模板的东西很好......对吗? [英] These template things are good...right?

查看:68
本文介绍了这些模板的东西很好......对吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许我只是有点沮丧,我很快就会意识到明确的事实

,但是现在我对这个价值有一些严重的疑虑

投入大量时间和精力进行模板编程。我只是完成阅读_C ++模板的前12章:完整的

指南。当我阅读这些章节时,有一件事让我印象深刻,那就是我对C ++的了解程度不高。我_know_核心语言规范是

包含在有限文档中,但我有时会感觉到C ++

需要无限量的学习。


主要的C ++语言(没有模板)本身就很强大且非常强大。有很多方面我还没有完全掌握。虽然我会批准使用模板可以帮助

支持其中的一些技能,但我不得不怀疑模板真的是多么有用。
。我发现使用模板的代码经常不会像我期望或想要的那样表现为
。一个例子是std :: for_each算法。我经常在其他语言中使用

- 每个成语,并且还使用Qt提供的Cpp

实现(尽管这在
$ b中有很大的局限性) $ b自己的权利)。然而,std :: for_each对我来说几乎没用了。


一个知道如何使用模板的程序员会非常好吗? />
比那些坚持使用C ++的传统OOP方面的人更有效率吗?

-

NOUN:1。遗嘱遗留给他人的金钱或财产。 2.从祖先或前任或过去那里下来的东西:b
宗教自由的遗产。 ETYMOLOGY:MidE legacie,副手办公室,来自OF,来自ML legatia的
,来自L legare,以及deute,遗赠。 www.bartleby.com/61/

Perhaps I''m just a bit frustrated, and I will soon realize the clear truth
of the matter, but right now I have some serious misgivings about the value
of investing a lot of time and effort into template programming. I just
finished reading the first 12 chapters of _C++ Templates: The Complete
Guide_. One thing that struck me as I read these chapters is how much I
didn''t know about C++. I _know_ the core language specification is
contained in a finite document, but I sometimes get the sense that C++
requires an infinite amount of learning.

The primary C++ language (without templates) is substantial and quite
powerful in itself. There are many aspects of that which I have yet to
fully master. While I will grant that working with templates can help
shore up some of those skills, I have to wonder how useful templates really
are. I have discovered that code using templates can frequently not behave
as I expect or want. An example is the std::for_each algorithm. I use the
for-each idiom frequently in other languages, and also use the Cpp
implementation provided with Qt (though that has significant limitations in
its own right). The std::for_each, however, has proved virtually useless
to me.

Will a programmer who knows how to use templates very well be significantly
more productive than one who sticks to the traditional OOP aspects of C++?
--
NOUN:1. Money or property bequeathed to another by will. 2. Something handed
down from an ancestor or a predecessor or from the past: a legacy of
religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/

推荐答案



Steven T. Hatton写道:

Steven T. Hatton wrote:

请知道如何使用的程序员模板很好地显着地比坚持C ++的传统OOP方面的人更有效率?b $ b?
Will a programmer who knows how to use templates very well be significantly
more productive than one who sticks to the traditional OOP aspects of C++?



是。

Yes.


Steven T. Hatton写道:
Steven T. Hatton wrote:

[...抱怨,抱怨..]

一个知道如何使用模板的程序员将会非常有效地使用b / b
一个坚持C ++传统的OOP方面的人?
[.. gripe, gripe ..]
Will a programmer who knows how to use templates very well be
significantly more productive than one who sticks to the traditional
OOP aspects of C++?



在什么团队中,做什么? IOW,是的,如果使用模板是那个程序员需要的
。不,如果使用模板不在他/她的日常活动中。


但是,请考虑一下你自己写的内容:在阅读本书时

模板你已经发现了多少你不知道核心

C ++语言。可以想象,坚持使用C ++的传统OOP方面的人。实际上并不像知识渊博那么bb在哪里核心 C ++比人们认为的要多。


你能学会阅读一门人类语言并声称能够熟练掌握它吗

没有,比方说,能说话?有些人非常擅长外语而不知道他们读的单词是怎么发音的。他们缺少多少?我不知道。

你实际测量的是什么?我能说的是他们的知识

是不完整的,非常人为的。根据单词的发音方式,他们肯定会遗漏一些

的笑话......当然,如果他们坚持使用传统的科学语言,他们甚至可以提高效率。 />
在一个他们不需要说话或理解语音的环境中

或理解基于文字游戏的笑话。


回答你的问题?


V

-

请用e-回复时删除资金'A'邮件

我没有回复最热门的回复,请不要问

In what team, doing what? IOW, yes, if using templates is what is
required from that programmer. No, if using templates is not in
his/her everyday activity.

However, consider what you yourself wrote: while reading the book on
templates you have discovered how much you didn''t know of the "core"
C++ language. It is conceivable that the "one who sticks to the
traditional OOP aspects of C++" is actually not as knowledgeable
where the "core" C++ is concerned than one thinks one is.

Can you learn to read a human language and claim proficiency in it
without, say, being able to talk? There were people who were very
versed in a foreign language without knowing how the words they read
or write are pronounced. Are they missing much? I don''t know. How
do you actually measure that? What I can say is that their knowledge
is incomplete and very artificial. They are definitely missing some
jokes based on how words are pronounced... Of course, if they stick
to the traditional scientific language, they can even be productive
in an environment where they don''t need to talk or understand speech
or understand jokes based on word play.

Does that answer your concerns?

V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask




Steven T .Hatton写道:

Steven T. Hatton wrote:

一个知道如何使用模板的程序员会比那些坚持传统模板的人更有效率吗? C ++的OOP方面?
Will a programmer who knows how to use templates very well be significantly
more productive than one who sticks to the traditional OOP aspects of C++?



对于模板的更高级使用,如果您使用的编译器

符合标准,则更简单,否则它可以是

令人沮丧。例如,你引用的模板书很少

在实践中用VC ++ 6.0或gcc< 3.0问题。


也许这对许多人来说是显而易见的,但是OTOH可能不是这样,如果你在

这个曾经使用过的职位一个较旧的编译器。


问候

Andy Little

For more advanced use of templates, it is much simpler if the compiler
you are using is reasonably standard conformant, else it can be
frustrating. For instance the Template book you cite would be little
use in practise with VC++6.0 or gcc < 3.0 methinks.

Maybe that''s obvious to many, but OTOH it may not be so if you are in
the position of only ever having used an older compiler.

regards
Andy Little


这篇关于这些模板的东西很好......对吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆