為什麼「Life is short」而不是 int 或 double?


子在川上曰:「逝者如斯夫,不舍晝夜。」

所以在他看來,大概 Life is float.


Because short is enough.
I. Short"s range: -32768~+32767, 32767 / 365 = 89.77
II. 89.77 years is long enough for most people.
III. If some one is overflow, there is unsigned short for him ... (0~65535, 179.54 years)
IV. Why day, not hour ? Because we live day by day.


因為不夠浪(long)啊


萬物皆空。Everything is void[1].

[1] 「空性(?ūnyatā)」在英文中可譯作 voidness。


花式虐狗!明明就是life is single!


Whether life is short or long depends on what you use it for.
By making contribution to the world, you can get your life extended, or even double it; but merely saying "hello" to the world with nothing meaningful done, your life is a float on a vast ocean.
And there are two kinds of people that are int, one is called "p", and the other is called "j".


Life is short, art is long.

箴言,希波克拉底。


因為short最大表示32767,按天算也就不到90年,而程序員大多活不到這個歲數:)


因為大多數人的壽命以天為單位取整後用short就可以存下來。存不下來的話ushort也能存下來,再存不下來就是bug一樣的存在。

感謝 @Freezind Chen 指正!


Life你還想double?


普通人的life is char*, 而輪子哥的life is wchar_t*;


好多答案答非所問。題主問的是,為什麼不是life is int? 不要迴避問題嘛。這種題需要橫跨相聲界,計算機界和英語界的全才,我試著一答。
==================
為什麼不是life is int?

int是integer的縮寫。

1508, "whole, entire" (adj.), from L.integer "whole," lit. "intact, untouched," from in- "not" +
root of tangere "to touch" (see tangent). Noun meaning "a whole number"
(opposed to fraction) first recorded 1571.

歸納一下integer的意思是,a thing that is not touched 完整的事物。即整數。

我們初中的時候「奇變偶不變,符號看象限」裡面說的tan是tangent的縮寫

1590s, "meeting at a point without intersecting," from L.tangentem (nom.tangens), prp. of tangere "to touch," from PIE base *tag- "to touch, to handle" (cf.L.tactus "touch," Gk.tetagon
"having seized,"

tangent里n為無實意輔音,e和a為母音變換可忽略,所以tang仍然是to touch

可以試著改成這樣子解釋:touching a curve at a point without intersecting,即相切

這一類詞隨手就可以舉出三五十個
contiguous disentangle intangible contingent contagious entangle tangle tact tactful tactics tactical tactile contact intact integerity disintegrate
加上衍生詞30個肯定是有的。

現在回到題主的問題,life is int 的意思應該是:
離散數學版本:月有陰晴圓缺的否命題
文藝青年版本:我要和你去麗江,我帶著你,你帶著錢。
電車痴漢版本:吳媽,我要和你睏覺

當我相信人生是圓滿的時候,我還是一個處。

double明天再說。


都別爭了,"Life"明明就是一個string!


這個問題真是程序員冷笑話大集合啊。我覺得吧,life作為變數的時候可能short也可能long,但被記錄下來以後都是real。


Actually, life is complex!


從「life is short」可以看出,life應為整數型,並且是強調的是短。所以用double會出現數據類型不匹配的BUG,而用了int的話,那就需要再好好分析需求了!
這是一個嚴肅的答案,不要笑。
(/≧▽≦/)


因為Life is short, please use Python:-).


對於單身狗來說,life明明是single。


short , 兩個位元組 . 換成位數的話 , 兩位數 ,人類一般很少活過2位數 ,更別說4位數和8位數啦 .

所以lift is short , just do it.


所以要use Python,short,int,long都不用區分了。


推薦閱讀:

你在寫語文作文時,為湊字數用過哪些套路?
如果因為災難被困在圖書館,應該按照怎樣的順序燒書取暖?
衛星可以攜帶部分燃料在戰爭時代對敵國衛星進行物理撞擊破壞么?
如果你有讓時間倒退 7 秒的超能力,你將如何使用?

TAG:計算機 | 段子 | 腦洞網路用語 |