国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
hello world, ruby
userphoto

2007.01.20

關注
java用了一段時間,有些膩了,而且ruby又是如此之火,所以想看個究竟,雖然我工作中使用ruby的可能性不大,但多學一門新語言總歸沒什么壞處,而且還可以吸收一些新的東西。

ruby是一種強大的腳本語言,作為腳本語言還有perl和python,我都沒用過,為什么會單單選擇ruby,我也說不出個所以然(也許ROR的原因),網(wǎng)上也有相關討論。

下面讓我們來看看Programming Ruby-2nd Ed的preface中ruby的設計者Yukihiro Matsumoto怎么說的

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迷,也想使用腳本語言,也在選擇使用哪種,當他發(fā)現(xiàn)perl不夠強大

和Python不夠OO的時候,他就設計了ruby,強!)


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.

(作者只是開始玩玩ruby后來當ruby變得強大,能取代perl的時候,作者于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說得夠猛,不排除作者在作廣告,但也難怪,不吹吹,連作者都不自信,誰會用

廢話說了這么多,開始hello word ruby

1)step1

下載ruby184-17_rc2.exe(this is for xp)

2) step2

安裝完成后,運行自帶的FreeRIDE,敲入代碼:

puts "hello,ruby"

(上面的代碼類似java中的System.out.println("hello,ruby"))

選擇IDE的run菜單和點擊run按鈕,你將看到控制臺中的結(jié)果

 

 居然發(fā)現(xiàn)在那個自帶的FreeRIDE,不能輸入中文,暈

本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
I, Analyst: Groovy: The Sleeping Giant
30分鐘python速成
關于腳本語言的評價--Python/Ruby/Perl/Lua
近50年來最具影響力的10種編程語言,都是誰發(fā)明的?
?50年來最具影響力的十大編程語言!
從國際編碼競賽來看編程語言受眾度
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服