-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: spark
Message 2 in Discussion


hi,
    
nice to see some interest in ruby. yes it is supposed to be rather popularin 
japan - the language is rather new and initially it had all its docs in jap so 
the rest of the world had some issues appreciating it. 
    
my personal interest comes from the fact it is beautiful as a language. if you 
are new to programming probably you should stay away from this.. else take a 
dive. it would certainly give our own jscript, vbscript and even perl a run 
for its worth.
 
you can get ruby 
here:
http://sourceforge.net/project/showfiles.php?group_id=67007
(approx 8-9 mb i 
think)
 
ruby comes with an 
editor - you will find scite.exe in the scite folder.
ruby files are saved 
with the .rb extension and to run a ruby prog go to the command line and 
type
    
ruby  <filename>
for 
example
    
ruby prog.rb
now if you set 
association of the rb extention to ruby.exe (in the bin folder) then you can 
simply type the file name at the command prompt to execute the ruby 
prog.
 
pasting from the 
ruby help file (programmingruby.chm)
<snip>
 
This book is a 
tutorial and reference for the Ruby programming language. Use Ruby, and you'll 
write better code, be more productive, and enjoy programming more. 



These are bold claims, but we think that after 
reading this book you'll agree with them. And we have the experience to back up 
this belief. 


As Pragmatic Programmers we've tried many, many 
languages in our search for tools to make our lives easier, for tools to help us 
do our jobs better. Until now, though, we'd always been frustrated by the 
languages we were using. 


Our job is to solve problems, not spoonfeed 
compilers, so we like dynamic languages that adapt to us, without arbitrary, 
rigid rules. We need clarity so we can communicate using our code. We value 
conciseness and the ability to express a requirement in code accurately and 
efficiently. The less code we write, the less that can go wrong. (And our wrists 
and fingers are thankful, too.) 


We want to be as productive as possible, so we 
want our code to run the first time; time spent in the debugger is time stolen 
from the development clock. It also helps if we can try out code as we edit it; 
if you have to wait for a 2-hour make cycle, you may as well be using punch 
cards and submitting your work for batch compilation. 


We want a language that works at a high level 
of abstraction. The higher level the language, the less time we spend 
translating our requirements into code. 


When we discovered Ruby, we realized that we'd 
found what we'd been looking for. More than any other language with which we 
have worked, Ruby stays out of your way. You can concentrate on solving the 
problem at hand, instead of struggling with compiler and language issues. That's 
how it can help you become a better programmer: by giving you the chance to 
spend your time creating solutions for your users, not for the compiler. 

Ruby 
Sparkles


Take a true object-oriented language, such as 
Smalltalk. Drop the unfamiliar syntax and move to more conventional, file-based 
source code. Now add in a good measure of the flexibility and convenience of 
languages such as Python and Perl. 


You end up with Ruby. 


OO aficionados will find much to like in Ruby: 
things such as pure object orientation (everything's an object), metaclasses, 
closures, iterators, and ubiquitous heterogeneous collections. Smalltalk users 
will feel right at home (and C++ and Java users will feel jealous). 

 
</snip>
 
 
if you are still 
reading :) try these little progs:
(i havent run them 
but i guess they should work)
 
1)
puts "Hello 
World"
 
2)
print "Hello 
world"
 
3)
10.times 
{
    
puts "Hello World"
}
 
4)
#this will print a 
file
filename = 
"textfile.txt"
file = 
File.new(filename)
file.each_line { 
|line|
    
puts line
}
 
5)
#the same 
prog
File.new("textfile.txt").each_line{|line| puts 
line}
 
6)
#example of a 
function call
def sample_function 
arg1
    
puts arg1
    
return arg1+" World"
end
 
str = 
sample_function "Hello"
puts 
str
 
 
if you are still 
reading this, try and read the ruby book (the chm file) that comes with the 
installation and then we will try do something interesting 
:)
 
cheers
    
rosh
 
 
 
 

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to