STL设计“好” wrt产生代码臃肿? [英] STL design "good" wrt producing code bloat?

查看:119
本文介绍了STL设计“好” wrt产生代码臃肿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

STL产生多少膨胀?这是一个很好的设计

wrt代码臃肿?实施方式有多大差异?


Tony

How much bloat does the STL produce? Is it a good design
wrt code bloat? Do implementations vary much?

Tony

推荐答案

" Tony" < rd ************** @ sbcglobal.netwrote in message

news:pn *************** @ newssvr21.news.prodigy.net。 ..
"Tony" <rd**************@sbcglobal.netwrote in message
news:pn***************@newssvr21.news.prodigy.net. ..

STL产生多少膨胀?
How much bloat does the STL produce?



无。一些。许多。这取决于你的膨胀概念和特定的实现。

None. Some. Much. It depends upon your
notion of ''bloat'' and the particular implementation.


这是一个好的设计

wrt代码臃肿?
Is it a good design
wrt code bloat?



Imo它的设计很好(使用我自己的概念

''good'')。请参阅上文关于''膨胀''。

Imo its design is good (using my own notion
of ''good''). See above about ''bloat''.


实施方式有多大差异?
Do implementations vary much?



是的。


-Mike

Yes.

-Mike



Tony写道:

Tony wrote:

STL产生多少膨胀?这是一个很好的设计

wrt代码臃肿?实现方式差异很大吗?
How much bloat does the STL produce? Is it a good design
wrt code bloat? Do implementations vary much?



一般来说STL容器和算法都会引入很少的b $ b膨胀和开销。它们通常针对它们构建的

编译器进行了优化。它们还大大提高了程序员的生产力。除非你看到特别使用STL容器或算法的问题,否则你只关心这个问题,这简直太愚蠢了。

。在规模,速度,质量或依赖性方面,很难超越常规的STL实施。


就设计而言...... STL是一件艺术品。

In general STL containers and algorithms are made to introduce little
bloat and overhead. They are usually very well optimized for the
compiler they are built for. They also increase programmer
productivity by a great margin. Unless you see a problem with a
particular use of an STL container or algorithm it is just plain silly
to concern yourself with such. It is very difficult to beat the usual
STL implementation in size, speed, quality, or dependency.

As far as design goes...the STL is a work of art.




" Noah Roberts" < ro ********** @ gmail.com写信息

新闻:11 ******************** *@73g2000cwn.googlegrou ps.com ...

"Noah Roberts" <ro**********@gmail.comwrote in message
news:11*********************@73g2000cwn.googlegrou ps.com...

>

Tony写道:
>
Tony wrote:

> STL产生多少膨胀?这是一个很好的设计
wrt代码臃肿?实现有多大差异?
>How much bloat does the STL produce? Is it a good design
wrt code bloat? Do implementations vary much?



一般来说STL容器和算法都会引入很少的b $ b膨胀和开销。它们通常针对它们构建的

编译器进行了优化。它们还大大提高了程序员的生产力。除非你看到特别使用STL容器或算法的问题,否则你只关心这个问题,这简直太愚蠢了。

。在规模,速度,质量或依赖性方面,很难击败通常的STL实现STL实现。


In general STL containers and algorithms are made to introduce little
bloat and overhead. They are usually very well optimized for the
compiler they are built for. They also increase programmer
productivity by a great margin. Unless you see a problem with a
particular use of an STL container or algorithm it is just plain silly
to concern yourself with such. It is very difficult to beat the usual
STL implementation in size, speed, quality, or dependency.



它的可读性虽然糟透了。如果有的话,人们会去哪里阅读

STL内存管理设计/架构?

Its readability sucks rocks though. Where would one go to read about
STL memory management design/architecture if anywhere?


就设计而言... STL是一件艺术品。
As far as design goes...the STL is a work of art.



也许如果您不尝试阅读或尝试从

实施中理解它!我认为是什么原因导致了这种类型安全的极端主义。我会使用一个void *或一个演员,明智地放置

,以便使代码更具可读性。但我想

标准必须是该领域的纯/极端。


Tony

Perhaps if you don''t try to read it or or try to understand it from the
implementation! I think what makes it that way is the extremism of
type safety. I''m would use a void* or a cast, judiciously placed
in order to considerably make code more readable. But I guess the
standard has to be pure/extreme in that area.

Tony


这篇关于STL设计“好” wrt产生代码臃肿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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