Before we dive into the topic of this post, I would like to share with you the best possible advise I could ever give – never do everything by the book.
I know it sounds kinda odd and may appear to be irresponsible. After all, this series is about what to avoid and promote best practice. Am I not asking you do what I tell you? No, I am not.
I am asking you to think and to reason consciously why you chose to code something the way you did.
In the first post of this series, I wrote about how returning early improves code readability. It may appear so in the code snip presented in the post. It may seem to be appropriate in scenarios off the top of your head. However, I am most certain that there are contexts where returning early actually does the opposite – hurting code readability.
It is important that we understand a best practice is anything but the law. When circumstances change, it may not stand.
I ask you to think as you code.
Now, back to the topic. In this post, we will revisit a well known best practice from a less discussed perspective. View full article »

re: 解读google C++ code style谈对C++的理解
想加入這篇 解读google C++ code style谈对C++的理解 的討論. 不幸由於不明原因, 一直被系統認為是廣告 (圖中紅字部份):
先留個底, 再看看該/能怎麼辦吧.
ps. cppblog 帳號申請中, 也許有帳號就沒這問題了吧? 不過, 看起來申請帳號要經過人工審核…
View full article »