You Don’t Have to Resort to Goto
Posted on June 19th, 2010 at 22:35 by fr3@K
你一定看過這樣的 code:
C:
-
int do_something(size_t n)
-
{
-
int result = ERROR;
-
char* buf;
-
-
if(n)
-
{
-
buf = malloc(n);
-
if(buf != 0)
-
{
-
if(do_foo(buf, n) == OKAY)
-
{
-
if(do_bar(buf, n) == OKAY)
-
result = OKAY;
-
}
-
free(buf);
-
}
-
}
-
-
return result;
-
}
可讀性差的巢狀 if block, 只為了堅持由一處 return.
(more...)
你怎麼在看簡體的東西!?
Posted on May 30th, 2010 at 16:31 by fr3@K
"你怎麼在看簡體的東西!?" 不久前, 一位同事在會議中看到我在 NB 上讀到一半的一篇簡體文章, 驚訝地對我說.
"醒醒吧老兄. 對岸華人同胞產出的技術性文章, 不論是原創或翻譯, 不管是數量甚至很可能連質量, 都超過我們了啊." 我心理的 OS.
是的, 我的 feed subscription 的數量: 英文 > 簡中 > 繁中.
台灣, 加油好嗎? 要了解自己, 搞清楚自己的強項面對自己的短處. 不必自大也不需自卑, 別成了井底之蛙.
後方, 起浪了
Posted on May 4th, 2010 at 23:54 by fr3@K
Pic of starryalley on iThome
Posted on March 24th, 2010 at 0:35 by fr3@K
[Update] boost::decay documentation issue
Posted on January 14th, 2010 at 17:35 by fr3@K