Beginner in Ruby

Hi all, my name is Thiago and I am completely new to Ruby. I'm having
OO class this semester and one of the languages we are using is Ruby.
For the final exam, we will have to build a software using OO concepts
and my group decided to do this task with Ruby. I'd like to know what
kind of software Ruby is best for and its limitations. I'm not asking
for ideas but for directions, so that we don't waste our time trying
to do something too difficult or impossible.
Best regards.

Get "The Ruby Way" by Hal Fulton. You'll get plenty of insights there
which will help you focus on a project.

HTH,
Richard

Hi Thiago,

First let me say welcome to Ruby. I just wanted to give a brief
comparison of Ruby to other languages I know:

1. Unlike most languages I've used, Ruby is full object-oriented. Most
OOP languages include a number of primitive (non-object) types. Not so
in Ruby. Essentially everything is an object in Ruby.

Take the following example:

5.times { puts "Hello" }

Notice that the number 5 is an object (an instance of Fixnum). We are
calling a "times" method on the instance and passing it a code block. In
that simple example there is exposed a lot of the power of the Ruby
language.

2. There are tradeoffs to a fully dynamic and interpreted language such
as Ruby. But, that's true for any language. Ruby is not compiled making
it more difficult to obscure your code. Ruby runs from source, which get
interpreted by the Ruby VM. The major tradeoff though is in performance.
On the positive side though Ruby is a fantastic and fun language. It's
by far my favorite language to develop with.

The only problem I see starting with Ruby is that you will likely not
enjoy developing in other languages nearly as much as if you had never
seen Ruby.

For example here's the Java for that earlier example:

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        for (int i = 0; i < 5; i++) {
            System.out.println("Hello");
        }
    }
}

thiagobrandam wrote:

You might better ask this question on comp.lang.ruby rather than this (rails) group.

I think the main limitations (right now anyway) are execution speed, debugger support, and maybe unicode support (or is that now covered?). Strengths are everything else. :wink:

What kind of a user interface do you want/need to have? It'd probably be easiest to do a command-line or web interface (the latter w/rails I'd think).

HTH,

-Roy

Hi guys, I appreciate your help very much.
Roy, there's no specification yet but we'd rather make a software with
a friendly user interface. Is it possible in Ruby?

Hope I am not hijacking the thread. I am a newbie to RoR as well and
wanted to know which book is more beneficial to learning this
language. I am a self taught programmer and learn best using books and
hands on trial and error.

1.) Railspace: building a social networking website with Ruby on Rails

2.) The Rails Way

3.) The Ruby Way

I would highly recommend getting a Ruby book , I personally liked 'The
Ruby Programming Language" by Flanagan and Matsumoto , before trying
to get into Rails. So your not trying to learn Ruby and Rails at the
same time. And once you have a basic understanding of Ruby , The Rails
Way is a excellent book.

James

I would say yes--certainly if you're content to use a web browser as the interface. Ruby (and rails particularly) is great for generating HTML & javascript. I'm not sure what the state of the various ruby bindings to the GUI widget toolkits like GTK+ & Qt is--suspect that's not quite as mature. But again--if that's your goal, you'd be much better off asking on comp.lang.ruby.

HTH,

-Roy