Re: Hello RoR

Phlip
Fri, 09 Mar 2007 15:44:14 -0000

Leonardoalmeidabastos wrote:

> I am a Java programmer and I started today with Ruby and also RoR. I am
> using the RadRails IDE (is that the best?) and I would like to know if
there
> is a auto-completation feature like in Eclipse for JAVA (ctrl + space for
> classes and methods). Do I need to install anything else?

Netbeans 6.0 has an auto completer, per other threads here.

> I am still learning the language''s sintax and I am loving it. It
is so
> intuitive and agile.

Eclipses''s autocompleter for Java is so good it makes you wonder - if
the editor can do everything, then what is the there language for?

Much of that autocompleting was simply "filling out forms to request
permission to do something". Ruby only needs like 10% of the source
lines of Java, so you will find yourself completing less and thinking
more.

To get a snapshot of what''s available, add this temporarily:

p myObject.public_methods.sort

The next problem with autocompletion is Java is static and Ruby is
dynamic. That means, in Java, you can determine the type of any object
without running the program. That''s what the autocompleter does. Ruby
saves lines by using a leaner system. You _can''t_ tell the type of any
object before running the program. So an autocompleter would need to
either guess or run the program.

If I were inventing an autocompleter, I would attach it to the test
system. (You _are_ using the unit tests, aren''t you?) Then at complete
time, I would fetch the type of each object from a log of the
execution of the tests.

Unit tests are part of the system that makes dynamic typing more
productive and robust than static typing.

--
  Phlip
  http://c2.com/cgi/wiki?ZeekLand  <-- NOT a blog!!