精華區beta Ruby 關於我們 聯絡資訊
這裡有一篇 Ruby , Python , Perl 中心思想比較 http://lightyror.blogspot.com/2006/09/rubypythonperl.html 寫的不好,請給予指教,我提出 Ruby 的部份 Ruby 的作者在接受訪問的時候提到 Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will run faster. By doing this, the machine will run more effectively. By doing this, the machine will something something something." They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves. 代表的意思是人們寫程式時不應該選擇了解機器做啥事情,以及怎麼做機器比較有效率 而應該考慮到 "人" 怎麼去想 人是比機器更高級的東西,應該要去思考該思考的東西 而不是將時間花在記憶體配置的問題上面 並且 Ruby 採用 the principle of least surprise (POLS),代表我們應該用機器應該 照人們的意思去做,而不是機器常常給人 Surprise !!! People are the masters. Machine are the slaves. 這就是Ruby最主要的中心思想,一切以人為本,方便人們思考為最重要的方向。 有些人形容讀 Ruby 就跟讀詩一樣,有些人覺得Ruby的文法很像英文 這些都是因為這個中心思想的原因。 但是 Ruby 很重視 Perl 的 There is more than one way to do it. 的觀念 (因為人本來就是喜歡多變化的,這也是符合以人為本的中心思想) 所以他也提供許多不同的文法選擇。 我是 Perl 出身的,很喜歡 Perl 的想法,但是我卻對 Perl 的 write-only 感到很麻煩 。後來投身 Ruby ,對Ruby的以人為本想法感到相當的疑惑,真的有那麼神奇嗎?後來漸 漸的發覺,我寫出來的code擁有簡單的結構,但是產生的效率跟可讀性非常的棒。並且 Ruby API 可以用猜的就猜出他的規律,不像 JAVA 還要 Documention 放在旁邊 =_= 。 漸漸的,我好像稍微可以掌握 The Ruby Way ... -- lighty RoR 是一個介紹 lighttpd , SQLite , Ruby and Rails 的 Blog http://lightyror.blogspot.com/ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.230.109.202 ※ 編輯: giive 來自: 61.230.109.202 (09/05 18:55)