[CodeSOD] Please Think Twice!
http://thedailywtf.com/Articles/Please-Think-Twice.aspx
"While reviewing some of our older code," Rob Jacobs wrote, "I stumbled upon
this."
"某天,我在翻閱一些舊CODE的時候",Rob Jacabs說,"我發現了這些東西"
// NOTE: Please think twice before changing the next line of code ;-D
// Store float binary in char array
*((unsigned int*)(&x[4])) = *((unsigned int*)(&value));
"I showed this to my coworkers," Rob continued, "and we all agreed: while
functional, this sort of thing will land you in your own circle in hell. I'd
be remiss not to scold the original coder for such bad practices, so I peeked
in SVN to see who was responsible."
"我把這段CODE SHOW給我同事看",Rob記敘說,"我們都同意:即使這段碼能作用,這
也絕對會讓人誤入歧途。我一定是忘了去好好念一下一下寫這段CODE的人,叫他好好
改一改。"所以,我去看了一下SVN的記錄,看這段CODE到底是誰搞出來的
$ svn log
r3 | rjacobs | Thu, 18 Jul 2002 18:03:46 -0500 | 10 lines
r2 | rjacobs | Mon, 15 Jul 2002 17:47:57 -0500 | 1 line
r1 | rjacobs | Mon, 15 Jul 2002 17:40:08 -0500 | 34 lines
"Whoops"
"哎呀我的媽"
--
XD
這篇我覺得是近期比較好笑的一篇 XD
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.120.35.85
推
09/02 12:32, , 1F
09/02 12:32, 1F
推
09/02 13:50, , 2F
09/02 13:50, 2F
推
09/02 14:26, , 3F
09/02 14:26, 3F
→
09/02 14:40, , 4F
09/02 14:40, 4F
推
09/02 15:08, , 5F
09/02 15:08, 5F
→
09/02 16:17, , 6F
09/02 16:17, 6F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章