home Mail List
Info
Info
Meetings
Goals
Upcoming
Projects
FAQ
Security
Links

[Date Prev][Date Next] [Chronological] [Thread] [Top]

[NMLUG] Ruby



Apparently, Don Wilde recently wrote:
> Have been doing some good work with Ruby these days. Anybody else out
> there as impressed as I am? I just bought a book about Rails and
> haven't started it, but the core Ruby language is so much clearer than
> Perl that in a comparison I'd have to call Perl a has-been except for
> CPAN. Thoughts?

In the domain where perl used to be useful, I almost exclusively use and 
teach Ruby, and have for some years now. There are a number of reasons 
behind this, but the easiest explanation is just that I like it, it's fun 
to use, it's easy to learn, it's a good language.

irb is great as an interactive calculator and/or prototyping shell, 
especially because of Ruby's intrinsic big-integer support and reflection. 
You can do this in other languages, but not with the same ease.

   What is 2**1000? 
irb(main):001:0> 2**1000
=> 
10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376

   What instance methods does a SHA1 object have besides regular Object 
instance methods?
irb(main):002:0> require 'sha1'
irb(main):002:0> SHA1.instance_methods.sort - Object.instance_methods
=> ["<<", "digest", "hexdigest", "update"]

I still use perl for quite a bit for the occasional "perl -pi -e 's/.../'" 
where sed can't do the job, only out of habit; Ruby's regular expressions 
are just as powerful, just not as sed-like when used on the command line.

I've haven't run into anything in CPAN (or a Python's library, or a C or C++ 
library) that I've needed that's not available for--or easily wrapped 
in--Ruby. In the very "worst" case (and often, this is good design anyway), 
a program can be split into several coprocesses that communicate over 
standard UNIX pipes, XMLRPC, shared memory, language embedding or whatever 
is appropriate--this way each part of a program can be written in whatever 
language is most suitable for the task at hand.

-- 
Wesley J. Landaker <wjl@icecavern.net>
OpenPGP FP: 4135 2A3B 4726 ACC5 9094  0097 F0A9 8A4C 4CD6 E3D2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.b9.com/pipermail/nmlug/attachments/20050815/2efc12e0/attachment.pgp

  • Follow-Ups:
  • References:


Please send sugestions and comments to webmaster@nmlug.org.
Valid XHTML 1.1! Valid CSS! Powered by Debian Powered by Apache