hello world, ruby
来源:百度文库 编辑:神马文学网 时间:2024/07/05 17:36:07
java用了一段时间,有些腻了,而且ruby又是如此之火,所以想看个究竟,虽然我工作中使用ruby的可能性不大,但多学一门新语言总归没什么坏处,而且还可以吸收一些新的东西。
ruby是一种强大的脚本语言,作为脚本语言还有perl和python,我都没用过,为什么会单单选择ruby,我也说不出个所以然(也许ROR的原因),网上也有相关讨论。
下面让我们来看看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迷,也想使用脚本语言,也在选择使用哪种,当他发现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年发布了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更流行,作者也希望在全世界也如此,小日本野心不小)
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按钮,你将看到控制台中的结果
居然发现在那个自带的FreeRIDE,不能输入中文,晕
ruby是一种强大的脚本语言,作为脚本语言还有perl和python,我都没用过,为什么会单单选择ruby,我也说不出个所以然(也许ROR的原因),网上也有相关讨论。
下面让我们来看看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迷,也想使用脚本语言,也在选择使用哪种,当他发现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年发布了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更流行,作者也希望在全世界也如此,小日本野心不小)
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按钮,你将看到控制台中的结果
居然发现在那个自带的FreeRIDE,不能输入中文,晕
hello world, ruby
Hello World
Hello World
Hello, World Page!
"Hello World" for RRDtool
VB.Net编程入门之Hello World
http,session,cookie分析 | Hello World!
常用RGB颜色表--Hello world!
Native C++ "Hello World" working in emulator
DWR的学习文档(Hello World,类型转换,Spring,Annotation)
在地表上秀出Hello, World!虽然有点麻烦...
JBPM 2 (Hello World) - 闲人茶馆 - JavaEye技术网站
DWR的学习文档(Hello World,类型转换,Spring,Annotation)
Hello World by Microsoft Speech SDK 5.1 - Vis...
JBPM 2 (Hello World) - 闲人茶馆 - JavaEye技术网站
二次开发之Hello World! - 二次开发和插件 - WPS Office官方论坛 ...
内部资金转移定价 FTP - Hello World :-) - CSDN博客
"Hello World" for RRDtool - 雨中怡然 - CSDNBlog
hello world: websphere portal v5 最简单的 portlet:第 1 部分,创建和部署
jBPM学习(六)----Hello World JBPM @net -JavaEye技术社区
hello world: websphere portal v5 最简单的 portlet:第 1 部分,创建和部署
[转] 我的第一個PSP程式: Hello World! PSP編程從這里開始!
Mac OS iphone 开发起步 初级教程 hello world (转) - 王超 ...
【易富国际】 - 给新入门CICS的朋友们----CICS下的Hello World! (本站长又一倾力之作)