Exception Handling 新思維, Using Guards
Posted on August 31st, 2008 at 20:41 by fr3@K

續自 Exception Handling 新思維.

Preface

取材來說明如何以某種技巧寫出俱備特定目的的 code 有時不是一件容易的事. 我讀過好幾本這樣的 programming 書籍, 即便書中用了不小的篇幅來說明範例相關的 domain/business logic, 可是我依然無法感同身受 (當然也有可能是我太笨). 但當要說明的目的是 exception safety, 那就簡單多了. 以最多 C++ programmer 熟悉的 STL 為例, 應該不會錯到哪裡去.

本文選的題目是 STL 的 uninitialized_fill_n. 雖然這個題目可能同時也是不錯的 template programming 教材, 但是為了避免失焦, 這篇文字將假設讀者對文中使用到的 template programming 技巧以及 STL 有足夠的熟悉度, 並略過部份與 exception safety 無關的細節. 另外, 為方便排版, 文中 code snippet (代碼片斷) 可能不同於引用的來源, 兩者在文中的 context 應為等效.

這篇文字要從 library implementor 的角度出發, 拿 STL 當題材, 探討不同手法的 implementation 俱備的特性.
(more…)

del.icio.us:Exception Handling 新思維, Using Guards digg:Exception Handling 新思維, Using Guards spurl:Exception Handling 新思維, Using Guards newsvine:Exception Handling 新思維, Using Guards furl:Exception Handling 新思維, Using Guards Y!:Exception Handling 新思維, Using Guards 黑米共享書籤:Exception Handling 新思維, Using Guards 推推王:Exception Handling 新思維, Using Guards
Sutter on Hungarian Notation
Posted on August 18th, 2008 at 16:10 by fr3@K

From Sutter’s Mill:

… The main trouble with Systems Hungarian comes from trying to embed information about a variable’s type into the variable’s name by prepending an encoded wart like the venerable sz, pach, ul, and their ilk. Although potentially helpful in a weakly-typed language like C, that’s known to be brittle and the prefixes tend to turn into lies as variable types morph during maintenance. The warting systems also don’t extend well to user-defined types and templates.

I am glad to learn that the Guru and I share similar views on this matter.


Further readings:

del.icio.us:Sutter on Hungarian Notation digg:Sutter on Hungarian Notation spurl:Sutter on Hungarian Notation newsvine:Sutter on Hungarian Notation furl:Sutter on Hungarian Notation Y!:Sutter on Hungarian Notation 黑米共享書籤:Sutter on Hungarian Notation 推推王:Sutter on Hungarian Notation
Exception Handling 新思維
Posted on August 18th, 2008 at 0:38 by fr3@K

New mind set

一直以來 exception handling 與 exception safety 就是 C++ 最重要的課題之一. 正確的 exception handling 真的不是一件跟吃蛋糕一樣容易的事.

但, 它是否一定如此困難, 以致於 只有語言專家才能搞得定? 我認為這與事實相去甚遠.
(more…)

del.icio.us:Exception Handling 新思維 digg:Exception Handling 新思維 spurl:Exception Handling 新思維 newsvine:Exception Handling 新思維 furl:Exception Handling 新思維 Y!:Exception Handling 新思維 黑米共享書籤:Exception Handling 新思維 推推王:Exception Handling 新思維
iGoogle, Not Safer than Anything Else?
Posted on August 10th, 2008 at 17:51 by fr3@K

Some of my friends use iGoogle as a portal for handling daily office routines. They had been selling me the solution for a while. They were able to get me to give iGoogle a test drive a few weeks ago.
(more…)

del.icio.us:iGoogle, Not Safer than Anything Else? digg:iGoogle, Not Safer than Anything Else? spurl:iGoogle, Not Safer than Anything Else? newsvine:iGoogle, Not Safer than Anything Else? furl:iGoogle, Not Safer than Anything Else? Y!:iGoogle, Not Safer than Anything Else? 黑米共享書籤:iGoogle, Not Safer than Anything Else? 推推王:iGoogle, Not Safer than Anything Else?