From: Chad Perrin Date: 2007-03-12T18:11:59+09:00 Subject: Re: I need to learn... On Mon, Mar 12, 2007 at 02:34:48PM +0900, 7stud 7stud wrote: > Marc Heiler wrote: > > on IRC it happens too often > > that people on rails dont know irb, and it can > > be frustrating to tutor people that are only, mostly interested > > in rails) > > > > I don't understand the distinction between "learning irb" and "learning > Ruby". For instance, if I am going to write a hello world program, I > open up a text editor, type in the code, save it, and then run it by > typing: > > ruby myProgram.rb > > I realize that you could do the same thing in irb, but editing is easier > in a text file. So, as far as I can tell, you don't ever have to use > irb to learn Ruby. Is there something important about irb that I am > missing? Actually, irb is basically just a command shell that uses Ruby as its scripting language, rather than something like bash, csh, or DOS batch files. It's an exceedingly nice command shell, though, and is worth learning for its own sake -- I use it as my calculator application, among other things. It helps with testing snippets of code when you want to test them before including them in a file you're editing, and you can use it for interactive language exploration. When I'm actually writing "serious" Ruby code, of course, I save it to a file in my text editor (I use Vim for that). I find that irb serves as an indispensable aid a lot of the time, however. Your mileage may vary. You don't *have* to use irb to learn Ruby, but sometimes it's pretty nice anyway. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] "There comes a time in the history of any project when it becomes necessary to shoot the engineers and begin production." - MacUser, November 1990