hello world, ruby

原创 2006年05月28日 23:59:00

用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 on rails开发从头来(windows)(二)-创建项目和第一个Hello world

在前面的“使用InstantRaisl快速搭建Ruby on rails环境”后,这一次说说如何创建自己的项目,并写一个最简单的Hello页面,例子是借用Agile Web Development...

Ruby之Hello World

Ruby 语言入门 一、Ruby安装 1、  到网络上下载Ruby,进行安装。下载页面:http://www.ruby-lang.org/en/downloads/ 在下载页面中,Ruby So...

Ruby on Rails,创建最简单的视图/控制器单元Hello World

http://blog.csdn.net/abbuggy/article/details/7409445 在Ruby on Rails,创建一个最简单的站点中我们通过rails new si...

ruby on rails安装和hello world

ruby on rails 环境搭建和hello world 程序

ruby创建项目和第一个Hello world

转自:http://developer.51cto.com/art/200908/147276.htm Ruby on Rails安装,有人说难,但其实也很方便。要基于ruby开发应用程序,我们必须...

Ruby On Rails 4 hello world,Ruby On Rails上手

有机会再试一试Rails了,只是原来接触的是2,现在已然变成了4,似乎现在的安装比原来会快些。。 Rails 4 安装 针对于安装了RVM gem install rails 没有的话应...

hello world

  • 2015-09-09 22:18
  • 15.13MB
  • 下载

边做边学Python Flask Web开发(3)-- Flask Hello World!

由于本系列教程叫做“边做边学”,因此我们在后续的讲解会以实践为主,穿插着介绍基本概念。请大家有条件的话跟着我们一起上机实践,而不要过于纠结深层次的原理,这些我们会在后续的教程中为大家慢慢解释。安装Fl...

first hello world for java

  • 2015-04-09 14:29
  • 106B
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)