程序員的初心
11月9日 星期六 陰
去了牡丹樓晚餐。4千步。
今日想了想,當初為什麽會做IT?少年時自己認識的IT工作只是寫程序。
回憶起過的物理學家Richman Feynman回憶錄。當時他做研究到了樽頸位,有些Burnout。但他重新發現他做物理的初心:(我看的是中文版,一時找不到原文,拿英文的充數)
I was in the cafeteria and some guy, fooling around, throws a plate in the air. As the plate went up in the air I saw it wobble, and I noticed the red medallion of Cornell on the plate going around. It was pretty obvious to me that the medallion went around faster than the wobbling.
I had nothing to do, so I start to figure out the motion of the rotating plate. I discover that when the angle is very slight, the medallion rotates twice as fast as the wobble rate. Then I thought, “Is there some way I can see in a more fundamental way, by looking at the forces or the dynamics?”
I don't remember how I did it, but I ultimately worked out what the motion of the mass particles is, and how all the accelerations balance... I still remember going to Hans Bethe and saying, “Hey, Hans! I noticed something interesting. Here the plate goes around so, and the reason it's two to one is ...” and I showed him the accelerations.
He says,”Feynman, that's pretty interesting, but what's the importance of it? Why are you doing it?”
“Hah!” I say.”There's no importance whatsoever. I'm just doing it for the fun of it.'' His reaction didn't discourage me; I had made up my mind I was going to enjoy physics and do whatever I liked.
其實就是有趣而矣。做出來的結果可能的沒什麽用,但做的過程很有趣。
工作的最後幾年,其實很無趣:做的過程很無趣,做出來的結果亦沒什麽用。正常的工作應是如此:過程可能沉悶,但結果真的幫別人解決問題,也會有些許成功感。但若解決的『問題』本身是為了些無聊的理由而做,長久下去真的會做到不想做。
現在不工作,可以自選題目,不如找個有趣的玩下。想起了小學時老師叫人計2的100次方。用寫程序計的話,應該有麻煩,因為int 得32 bit,long int 得64 bit,要自己做過array儲? 既然在學習Python,就用Python試試...
用Float 試試,30個位,正常:
for i in range(1, 101):
print (i, 2.0**i)
1 2.0
2 4.0
...
100 1.2676506002282294e+30
再用Int 試試,以為出Error Message,但
for i in range(1, 101):
print (i, 2**i)
================================1 2
2 4
...
100 1267650600228229401496703205376
無事,立即完成。解題的過程太快,未感受到趣味已做完。
Comments
Post a Comment