{book}读后感,Beyond the C++ Standard Library – An Introduction to Boost

7 views
Skip to first unread message

liuxinyu

unread,
Sep 12, 2009, 10:23:58 PM9/12/09
to TopLanguage
多谢meta,总给我介绍书,只不过我读得太慢,总是赶不上他给我介绍新书的速度。不过我努力一本一本都读完。
由于我读得太慢这本也从当初的新书变成老书了...

I just finished reading this book (e-book). Actually, I got this book
about more than 2 years ago (about 2997?). I thought boost is just a
extenstion to STL at that time. While things changed so fast, boost
grows and affects the whole C++ deeply. The coming new C++ standard
will take many great libraries and ideas from boost.

刚刚读完此书(英文电子版),我大约2年前(2007?)得到了本书的电子版。当时我不过认为boost是STL的一个扩充。但是boost的发展突飞
猛进,影响深远,以至于未来的C++标准预计会把相当多的boost库及其概念引入。

This book is not the the complete reference to boost. Just as the
title said, it’s an introduction. I believe it could a door opener to
the boost for most of the readers. After read it, I found boost
library contributors tried their best to provide a very good toolbox,
many freatures which have to be implemented inside other languages are
implemented as C++ library. for example, reference count pointers,
triple, lambda etc.

正如本书标题,这本书并非是对boost的完整参考,而是一个对boost的简介。我相信对于大多数读者来说,它会是一个入门的钥匙。读完此书,我感
觉 boost的贡献者们尽力为它的用户提供了一集非常出色的工具。有很多其他语言中必须在语言级别才能提供的功能,都被boost以库的形式加以实
现,例如引用计数指针,triple,和lambda等。

Some people critisize that boost uses too many tricks in C++, I think
end users of boost needn’t care about those tricks in most of the
time. Then only need to know how to use it and that will definitely
improves the productivity. By just using boost, programmers can feel
like combine a light weight scripting language such as python, or a
functional language to powerful triditional C++.

有人批评boost使用了太多的C++“奇淫巧计”。我认为对于boost的最终用户来说,他们基本不必关心这些技巧。只要用就可以了,并且明显
boost可以提高程序员的生产率。使用boost,程序员应该感觉像是把传统的C++和一些轻量级的脚本语言(如python)和函数式语言结合在一
起了。

On the other hand, I think boost is hard to the library developers who
want to hack boost itself. But to those who continously tracking C++
evolution, it is a good example to show you how the language changes
to the directions.

另一方面,对于那些开发库和想亲自hack boost的人来说,的确难度不小。但是如果一直跟踪C++的进展,就会发现boost给出了一个非常好的
案例,也许揭示了语言未来发展的若干方向。

Finally, I think this book can also be a good book to cover other
aspects of programming. at least it reminds me something about STL,
design pattern, regular expression, functional programming etc.

最后,我觉得本书不错,还覆盖了一些其他的关于程序设计的方面。至少它帮助我复习了一些东西,例如STL, 设计模式,正则表达式,和函数式编程等等。

missdeer

unread,
Sep 13, 2009, 2:42:55 AM9/13/09
to TopLanguage
这书我也看过其中一些章节,主要是bind和lambda,总的说来,很适合boost新手看,到后来就渐渐习惯boost自带文档的风格了,这本书的
作用就不大了。

Kula

unread,
Sep 13, 2009, 4:14:12 AM9/13/09
to pon...@googlegroups.com
想提高生产力为啥用c++呢


Mike Ditka  - "If God had wanted man to play soccer, he wouldn't have given us arms."

2009/9/13 missdeer <miss...@gmail.com>

dachuan lin

unread,
Sep 13, 2009, 7:29:30 AM9/13/09
to pon...@googlegroups.com
我不赞成老兄的说法,其实C++用得好的话,是很能提高生产力的,更不用说在 音视频编解码,实时网络大流量传输,嵌入式开发和接口驱动等领域,其他的语言基本上可以参考的opensource非常少,即使有也是效率极低


2009/9/13 Kula <kula...@gmail.com>

Eric

unread,
Sep 13, 2009, 9:23:55 AM9/13/09
to TopLanguage
非常支持 liuxinyu 同学用英语写作,更加难得的是还有汉语对照。
正好这会儿有闲,帮您改一下个别的词句吧.
说实话有点好为人师且装逼,不过倒是想同时借这个机会说一下英语写作的事情.
我以前的英语写作也是错误一大堆,也是慢慢改过来的。

I just finished reading this book (e-book). Actually, I got this book
about more than 2 years ago (about 2997?).

[about 和 more than 不可以同时使用,about 是"左右", more than 是多余]

I thought boost is just a
extenstion to STL at that time. While things changed so fast, boost
grows and affects the whole C++ deeply. The coming new C++ standard
will take many great libraries and ideas from boost.

刚刚读完此书(英文电子版),我大约2年前(2007?)得到了本书的电子版。当时我不过认为boost是STL的一个扩充。但是boost的发展突

猛进,影响深远,以至于未来的C++标准预计会把相当多的boost库及其概念引入。

[
boost is -> boost was

a extension -> an extension

这里 things changed so fast 不能作为 while 的成分,这句话没有任何意义, 你的中文是 boost 的发展很快,所

直接写 The boost library grows fast. 任何时候,如果你想表达一个含义,用陈述句直接表达,从句不能占用原来陈述句的
核心动词,而只能作为修饰。

whole C++ 这个短语不合语法习惯, 如果你想表达影响了 C++ 的各个方面,可以说 all aspects of the C++
language]
事实上你不能说 whole +名词,如果这个名词本身没有包含"组件"或者"集合"的概念。

您的中文说了一个 "预计",但是这个词在英文中没有表现出来,所以你的最后一句话实际上是一个 opinion, 却以 fact
statement 的形式表现出来,这是非常容易引起混淆的。 比较好的说法是: It is predicted that the
coming C++ standard will....
]

This book is not the the complete reference to boost. Just as the
title said, it’s an introduction. I believe it could a door opener to
the boost for most of the readers. After read it, I found boost
library contributors tried their best to provide a very good toolbox,
many freatures which have to be implemented inside other languages are
implemented as C++ library. for example, reference count pointers,
triple, lambda etc.

正如本书标题,这本书并非是对boost的完整参考,而是一个对boost的简介。我相信对于大多数读者来说,它会是一个入门的钥匙。读完此书,我感
觉 boost的贡献者们尽力为它的用户提供了一集非常出色的工具。有很多其他语言中必须在语言级别才能提供的功能,都被boost以库的形式加以实
现,例如引用计数指针,triple,和lambda等。

[it could a door .. -> it could be a door opener 中文有一个“是”]
[after read it -> after reading it]
[ a very good toolbox 后面应该是句号,您的中文是句号,英文却没有断句]
[ many features 后面应该对应 as C++ libraries,注意单复数的一致]
[ for example 这一句,相当于是前面的具体化,在中文里,可以直接说例如,但是注意中文这里 例是主语,如是谓语,而英语中则缺少主谓成
份,所以不成一句话了,可以改为 example includes reference counting pointers, triples
and lambda calculus]

Some people critisize that boost uses too many tricks in C++, I think
end users of boost needn’t care about those tricks in most of the
time. Then only need to know how to use it and that will definitely
improves the productivity. By just using boost, programmers can feel
like combine a light weight scripting language such as python, or a
functional language to powerful triditional C++.

有人批评boost使用了太多的C++“奇淫巧计”。我认为对于boost的最终用户来说,他们基本不必关心这些技巧。只要用就可以了,并且明显
boost可以提高程序员的生产率。使用boost,程序员应该感觉像是把传统的C++和一些轻量级的脚本语言(如python)和函数式语言结合在

起了。

[ they only need to know how to use it 的 it 指代不明, 应该要直接写成 boost
library. 注意你中文这里省却了宾语,英文却没有,
will definitely improves the productivity -> .. improve
productivities ]

On the other hand, I think boost is hard to the library developers who
want to hack boost itself. But to those who continously tracking C++
evolution, it is a good example to show you how the language changes
to the directions.

另一方面,对于那些开发库和想亲自hack boost的人来说,的确难度不小。但是如果一直跟踪C++的进展,就会发现boost给出了一个非常好

案例,也许揭示了语言未来发展的若干方向。

[hard 后面要 for 某人 to 做,光说 hard, 并不能表明完整的含义。 你不能说 boost 难(虽然中文可以,因为你后边紧跟了
一个动词),英语里你把这个动词放到 want to hack 那里了,但是意思就不明朗了,你要像中文一样,明白的表达是学习 boost难还是
用 boost 难, 或者 hack boost 难。

您的中文说了"未来发展的若干方向"作为宾语,但是在英文中这个宾语缺失了,变成了 changes to the directions, 所以很难
理解你要表达什么。 其实比较好的说法应该是直接的 Boost might be a good example to show some
future directions of the C++ language development. 就很直接。]

Finally, I think this book can also be a good book to cover other
aspects of programming. at least it reminds me something about STL,
design pattern, regular expression, functional programming etc.

最后,我觉得本书不错,还覆盖了一些其他的关于程序设计的方面。至少它帮助我复习了一些东西,例如STL, 设计模式,正则表达式,和函数式编程等
等。

--------------

可能还有其他的语法错误,我就不一一说了,我想说的是,我们在写英语的时候,很多时候甚至没有注意“忠实的表达自己的意思”.

如果以 liuxinyu 同学想要表达的中文意思为基准,那么就会发现,中文翻译到英文的过程中,我们在很多地方忽略了句子成份,或者改变的句子结
构,从而也改变了自己要表达的意思。 语言之间有形式的不同是必然的,不过意思的表达是不该缺失的。 为什么有些意思在表达中缺失了呢,是因为中文的语
法比较松散,因此一句话在写下来的的时候,我们不会仔细注意句子的结构和成份。 比如你写下"例如"的时候,你不会仔细考究这句话的结构的,因为你已经
写了几百个例如了。这个句子直译到英语,成了 for example, 就会发现,这不能单独成为一个句子。

这样的一个 gap, 有很多人把他解释成语感,其实不完全正确。 这种问题,完全可以通过训练思维来纠正的。纠正的方法也很简单,就是避免用松散的语
言思考。 但是中文本来就是我们的母语,也是松散的语言,怎么办呢。 最好的方法就是先有一个英文的初稿,然后回读这个英文的初稿,这时候就注意切换到
英语模式思考, 细细考究每句话是否表达了自己原来的意思。 如果没有,想想什么缺失了,把关键词列出来, 插入到句子中间去,或者替换掉一些词。 用
这样迭代式改进的方法,既可以锻炼自己的思维,也提高了自己的英语。 基本上,以我个人为例,没有反复阅读和修改三遍的英文写作,是一定有语法错误和表
达不清的。

我的英语写作水平也不见得高,上面说的这些也不见得对,甚至是错误的,请各位自己判断了。

windstorm

unread,
Sep 13, 2009, 12:57:23 PM9/13/09
to pon...@googlegroups.com
Eric你真闲:)

补充一点,可能正是书面表达whole C++有问题,口语里面讲究没那么多,有的甚至native
speaker的blog可能也不会这么讲究。我不止一次听到native speaker说whole java或者whole java
thing或者whole android这些东西。

----------------------------------------------------------------------------------
Yours Sincerely
Kun

www.forwind.cn
http://twitter.com/lk_517


2009/9/13 Eric <xu.ma...@gmail.com>:

xpol

unread,
Sep 18, 2009, 11:29:25 PM9/18/09
to TopLanguage
恩,我也是看这本书入门的,当然现在仍然没有登堂入室。

对Boost用的比较多的是bind/lambda/smart_ptr.
Boost给我最大的震撼是里面的template meta programming,让我觉得,原来C++程序也可以这样写。

Dong Feng

unread,
Sep 19, 2009, 12:03:40 AM9/19/09
to pon...@googlegroups.com

Shared pointer是好东西。可是有两个弱点,第一是循环引用(这个不算致命);第二是它是库而不是语言强制,所以工程大了,总有不守规矩的人随便用raw pointer——如此shared pointer就完全无力化了。



2009/9/19 xpol <xpo...@gmail.com>
Reply all
Reply to author
Forward
0 new messages