Sunday, June 14, 2009

Answers to BACE Ruby Review #1

When was Ruby created?
Ruby was created in 1995, the same year that Java was created.

Who created it?
Yukihiro Matsumoto, known as "Matz" in the Ruby community.

Is Ruby an interpreted language or a compiled language?
Interpreted.

What's the difference?
Interpreted language do not need to be compiled, they are just executed.

What can you use irb for?
Interactive Ruby is good for testing small pieces of code.

How much does Ruby cost?
Ruby is free.

How can you tell which version of Ruby is installed on a computer?
Execute ruby -v at the command prompt.

What are the 'nouns' of object oriented programming called?
Objects.

What are the 'verbs' called?
Methods.

Name three Ruby classes that we talked about last week.
String, Fixnum and Bignum.

Name three methods.
puts, class, methods.

What are all methods called on?
All methods -- even puts -- are called on objects.

What do all methods return?
All methods return objects; sometimes the returnd object is meaningful and sometimes it isn't.

What does the nil object mean?
The absence of anything.

What is an array?
An array is a collection of objects.

What are two ways to create a String object?
s = 'cat'
s = String.new('cat')

What are two ways to create a Fixnum object?
n = 10
n = String.new(10)

What are two great reasons for learning Ruby?
It's compact and it can be fun.

What is the difference between the puts method and the print method?
puts inserts a new line character at the end of the string and print doesn't.

What is the popular Web development that's written in Ruby called?
Ruby on Rails, usually just called Rails.

No comments:

Post a Comment