ruby是一種強大的腳本語(yǔ)言,作為腳本語(yǔ)言還有perl和python,我都沒(méi)用過(guò),為什么會(huì )單單選擇ruby,我也說(shuō)不出個(gè)所以然(也許ROR的原因),網(wǎng)上也有相關(guān)討論。
下面讓我們來(lái)看看Programming Ruby-2nd Ed的preface中ruby的設計者Yukihiro Matsumoto怎么說(shuō)的
Years later I talked with colleagues about scripting languages, their power and possibility.
As an object-oriented fan for more than fifteen years, it seemed to me that OO
programming was very suitable for scripting too. I did some research on the ’net for a
while, but the candidates I found, Perl and Python, were not exactly what I was looking
for. I wanted a language more powerful than Perl and more object-oriented than
Python.
(可以看出作者也是OO迷,也想使用腳本語(yǔ)言,也在選擇使用哪種,當他發(fā)現perl不夠強大
和Python不夠OO的時(shí)候,他就設計了ruby,強?。?/p>
Then, I remembered my old dream and decided to design my own language. At first I
was just toying around with it at work. But gradually it grew to be a tool good enough
to replace Perl. I named it Ruby—after the precious red stone—and released it to the
public in 1995.
(作者只是開(kāi)始玩玩ruby后來(lái)當ruby變得強大,能取代perl的時(shí)候,作者于95年發(fā)布了ruby)
Since then a lot of people have become interested in Ruby. Believe it or not, Ruby is
actually more popular than Python in Japan right now. I hope that eventually it will be
just as well received all over the world.
(ruby在日本比python更流行,作者也希望在全世界也如此,小日本野心不?。?/p>
I believe that the purpose of life is, at least in part, to be happy. Based on this belief,
Ruby is designed to make programming not only easy but also fun. It allows you to
concentrate on the creative side of programming, with less stress. If you don’t believe
me, read this book and try Ruby. I’m sure you’ll find out for yourself.
(設計ruby的目的是為了使編程不僅容易而且好玩)
把ruby說(shuō)得夠猛,不排除作者在作廣告,但也難怪,不吹吹,連作者都不自信,誰(shuí)會(huì )用
廢話(huà)說(shuō)了這么多,開(kāi)始hello word ruby
1)step1
下載ruby184-17_rc2.exe(this is for xp)
2) step2
安裝完成后,運行自帶的FreeRIDE,敲入代碼:
puts "hello,ruby"
(上面的代碼類(lèi)似java中的System.out.println("hello,ruby"))
選擇IDE的run菜單和點(diǎn)擊run按鈕,你將看到控制臺中的結果
居然發(fā)現在那個(gè)自帶的FreeRIDE,不能輸入中文,暈
聯(lián)系客服