Learning and Teaching Modern C++ ,CppCon 2017, Bjarne Stroustrup

他认为有时候我们要做一些unreasonable things,这样可更好地推动进步
image.png

nobody knows enough, nobody can be precise enough, nobody can give brief advice that is wide enough to actually help people
I find wrting things down is really, really helpful , especially you show it with some people, you can get something that is better than what you first thought out
他发现把想法写下来很有用,如果再拿来与人讨论,往往会得到比先前自己一个人更好的结论

当做teaching时,always give rationale[基本原理],即讲清楚为什么

the purpose of good teaching is to get good ideas, techniques into a student’s head

image.png

看到55分钟,开始讲c++ core guideline

C++ Core Guidelines - Modernize your C++ Code Base, C++Now 2017, Peter Sommerlad


主要是把github上的cpp core guideline给大致上讲了下
image.png

在编译选项上支持ISO 标准,
image.png

用variant代替union
不用cast,用cast往往代表抽象有问题
不要将数组传给指针,使用span, string_view, array<>
curly 初始化可以禁止narrowing conversion

image.png