Archive for February, 2008
Rubyプログラミングの特徴
Rubyプログラミングはオブジェクト指向プログラムである。以下のような4段階の変数スコープを持つ。
1.グローバル変数
2.クラス変数
3.インスタンス変数
4.ローカル変数
例外処理機能も備えている。イテレータとクロージャは渡されるブロックのコードに基づいている。Rubyは、言語レベルにおいてはネイティブなPerl風の正規表現である。そのプログラムは、自動ガーベジコレクション機能、演算子のオーバーロード機能などを備えた、非常にポータブルなもの。
グリーンスレッドを使用することにより、すべてのプラットフォームで使用可能な、複数同時処理が行えるようにマルチスレッド化されている。
大容量の標準ライブラリとDLL(共有ライブラリ)のダイナミックローディング機能を備えている。Rubyは依存性の注入(dependency injection)とオブジェクトランタイムの変更をサポートしている。また現状では、UTF-8の部分的なサポートは行っているものの、Unicodeの全面的なサポートは行っていない。
Rubyインストールのコツ
簡単な5つの手順でRubyをインストールできます!
手順1: Rubyの最新リリース版にアクセスして、DLおよびインストールを行う。
手順2: Aptana IDEのDLおよびインストールも忘れてはいけない。
手順3: Aptana IDEをインストールした後、Ruby拡張モジュールをインストールする(これは任意だが)。Aptana IDEを使用して「Help」「Software Updates」「Find and Install」「Search」の順にクリックしてインストールする新機能を検索する。
手順4: テストのため、Aptana IDEからRubyのプロジェクトを新規作成する。作成したRubyのサンプルはすべてここに格納される。
手順5: 「HelloWorld.rb」というファイル名で以下のサンプルコードを作成して、「Run HelloWorld.rb」をクリック。はじめてのRubyプログラムの出力結果を確認できる。
これで手順はすべて終了! Rubyプログラミングの使用と学習を始めることができる!
Why should you learn the Ruby Language?
Beginners nowadays usually starts with Java, C++ or C#. We must keep in mind that every programming language has its own strengths and weaknesses. The Ruby Language is still unknown to some students (and even programmers) but I believe that we should study this wonderful language because of the following reasons
The Ruby Language is one of the easiest to work with among languages I have encountered so far. According to some of Ruby devotees, it is a flexible language. You can easily extend class definitions and redefine anything and you can freely add built-in classes.
In a way, Ruby makes a programmer creative. Plumbing code is less required and you can concentrate on the problem itself. Blocks can help you out make the code efficient.
Ruby might still be considered as a “newbie” in the programming language world, but it’s getting a lot of attention lately due to the testimonials of its users. A Ruby Language can help you built web applications in an instant!





