You Don’t Have to Resort to Goto
Posted on June 19th, 2010 at 22:35 by fr3@K

你一定看過這樣的 code:

    C:
    1. int do_something(size_t n)
    2. {
    3.   int result = ERROR;
    4.   char* buf;
    5.  
    6.   if(n)
    7.   {
    8.     buf =  malloc(n);
    9.     if(buf != 0)
    10.     {
    11.       if(do_foo(buf, n) == OKAY)
    12.       {
    13.         if(do_bar(buf, n) == OKAY)
    14.           result = OKAY;
    15.       }
    16.       free(buf);
    17.     }
    18.   }
    19.  
    20.   return result;
    21. }

可讀性差的巢狀 if block, 只為了堅持由一處 return.
(more...)

del.icio.us:You Don't Have to Resort to Goto digg:You Don't Have to Resort to Goto spurl:You Don't Have to Resort to Goto newsvine:You Don't Have to Resort to Goto furl:You Don't Have to Resort to Goto Y!:You Don't Have to Resort to Goto 黑米共享書籤:You Don't Have to Resort to Goto 推推王:You Don't Have to Resort to Goto
華碩品質, 以卵擊石
Posted on June 2nd, 2010 at 1:24 by fr3@K

很多人可能已經沒印象了. 但我記得很清楚.

去年 5 月底, The Register 所做的一則 報導:

Microsoft and Asus have teamed up to present a new advertising smarm-storm intended to extol the virtues of Windows on netbooks - and smear Linux.

(more...)

del.icio.us:華碩品質, 以卵擊石 digg:華碩品質, 以卵擊石 spurl:華碩品質, 以卵擊石 newsvine:華碩品質, 以卵擊石 furl:華碩品質, 以卵擊石 Y!:華碩品質, 以卵擊石 黑米共享書籤:華碩品質, 以卵擊石 推推王:華碩品質, 以卵擊石
你怎麼在看簡體的東西!?
Posted on May 30th, 2010 at 16:31 by fr3@K

"你怎麼在看簡體的東西!?" 不久前, 一位同事在會議中看到我在 NB 上讀到一半的一篇簡體文章, 驚訝地對我說.

"醒醒吧老兄. 對岸華人同胞產出的技術性文章, 不論是原創或翻譯, 不管是數量甚至很可能連質量, 都超過我們了啊." 我心理的 OS.

是的, 我的 feed subscription 的數量: 英文 > 簡中 > 繁中.

台灣, 加油好嗎? 要了解自己, 搞清楚自己的強項面對自己的短處. 不必自大也不需自卑, 別成了井底之蛙.

del.icio.us:你怎麼在看簡體的東西!? digg:你怎麼在看簡體的東西!? spurl:你怎麼在看簡體的東西!? newsvine:你怎麼在看簡體的東西!? furl:你怎麼在看簡體的東西!? Y!:你怎麼在看簡體的東西!? 黑米共享書籤:你怎麼在看簡體的東西!? 推推王:你怎麼在看簡體的東西!?
re: 解读google C++ code style谈对C++的理解
Posted on May 30th, 2010 at 16:11 by fr3@K

Screenshot-解读google C++ code style谈对C++的理解 - 那谁的技术博客 - C++博客 - Mozilla Firefox
想加入這篇 解读google C++ code style谈对C++的理解 的討論. 不幸由於不明原因, 一直被系統認為是廣告 (圖中紅字部份):

先留個底, 再看看該/能怎麼辦吧.

ps. cppblog 帳號申請中, 也許有帳號就沒這問題了吧? 不過, 看起來申請帳號要經過人工審核...
(more...)

del.icio.us:re: 解读google C++ code style谈对C++的理解 digg:re: 解读google C++ code style谈对C++的理解 spurl:re: 解读google C++ code style谈对C++的理解 newsvine:re: 解读google C++ code style谈对C++的理解 furl:re: 解读google C++ code style谈对C++的理解 Y!:re: 解读google C++ code style谈对C++的理解 黑米共享書籤:re: 解读google C++ code style谈对C++的理解 推推王:re: 解读google C++ code style谈对C++的理解
後方, 起浪了
Posted on May 4th, 2010 at 23:54 by fr3@K

後方的浪.

del.icio.us:後方, 起浪了 digg:後方, 起浪了 spurl:後方, 起浪了 newsvine:後方, 起浪了 furl:後方, 起浪了 Y!:後方, 起浪了 黑米共享書籤:後方, 起浪了 推推王:後方, 起浪了
Pic of starryalley on iThome
Posted on March 24th, 2010 at 0:35 by fr3@K

哈~ 同事 starryalley 的照片上了 iThome.

del.icio.us:Pic of starryalley on iThome digg:Pic of starryalley on iThome spurl:Pic of starryalley on iThome newsvine:Pic of starryalley on iThome furl:Pic of starryalley on iThome Y!:Pic of starryalley on iThome 黑米共享書籤:Pic of starryalley on iThome 推推王:Pic of starryalley on iThome
Quiz on C++ Object Model
Posted on March 4th, 2010 at 0:07 by fr3@K

這幾個月忙於工作, 這個部落格都快被我給荒廢掉了. 昨晚終於花了時間完成了一篇積了一兩個月, 說明 virtual function 在執行時期的 override 過程以及 virtual function 與 constructor/destructor 混搭結果 的文字.

今天我準備了個題目給花了時間看了它的朋友, 當作對小弟的說明能力來個測驗. 請問, 下面的 code snip 的輸出結果是什麼?
(more...)

del.icio.us:Quiz on C++ Object Model digg:Quiz on C++ Object Model spurl:Quiz on C++ Object Model newsvine:Quiz on C++ Object Model furl:Quiz on C++ Object Model Y!:Quiz on C++ Object Model 黑米共享書籤:Quiz on C++ Object Model 推推王:Quiz on C++ Object Model
當 Constructor 遇上 Virtual Function
Posted on March 3rd, 2010 at 0:19 by fr3@K

Background

不知道你有沒有過這樣的經驗 - 想要在父類的 constructor 裏面呼叫被子類 override (或是 implement) 的 (pure) virtual function?
(more...)

del.icio.us:當 Constructor 遇上 Virtual Function digg:當 Constructor 遇上 Virtual Function spurl:當 Constructor 遇上 Virtual Function newsvine:當 Constructor 遇上 Virtual Function furl:當 Constructor 遇上 Virtual Function Y!:當 Constructor 遇上 Virtual Function 黑米共享書籤:當 Constructor 遇上 Virtual Function 推推王:當 Constructor 遇上 Virtual Function
[Update] boost::decay documentation issue
Posted on January 14th, 2010 at 17:35 by fr3@K

The issue with boost::decay documentation that I blogged about 10 days ago has been fixed in trunk.

del.icio.us:[Update] boost::decay documentation issue digg:[Update] boost::decay documentation issue spurl:[Update] boost::decay documentation issue newsvine:[Update] boost::decay documentation issue furl:[Update] boost::decay documentation issue Y!:[Update] boost::decay documentation issue 黑米共享書籤:[Update] boost::decay documentation issue 推推王:[Update] boost::decay documentation issue
What Should We Teach New Software Developers? Why?
Posted on January 5th, 2010 at 0:29 by fr3@K

Would you trust someone who had not seen a patient for years to teach surgery? What would you think of a piano teacher who never touched the keyboard? A CS education must bring a student beyond the necessary book learning to a mastery of its application in complete systems and an appreciation of aesthetics in code.

這句話說得真好.

via: What Should We Teach New Software Developers? Why? - Bjarne Stroustrup.

del.icio.us:What Should We Teach New Software Developers? Why? digg:What Should We Teach New Software Developers? Why? spurl:What Should We Teach New Software Developers? Why? newsvine:What Should We Teach New Software Developers? Why? furl:What Should We Teach New Software Developers? Why? Y!:What Should We Teach New Software Developers? Why? 黑米共享書籤:What Should We Teach New Software Developers? Why? 推推王:What Should We Teach New Software Developers? Why?

Page 1 of 23[ 1 ]2345»...Oldest