New Coder on the Block

This is my first post here and I just started learning Ruby a few days ago, so forgive me if I sound a little ignorant. That said, I do have some questions...

I come from Perl land and I'm wondering about some similar resources that I valued there.

First, there is an excellent mailing list called Perl Beginners, where coders learning the ropes post code they need help with and get tips from the pros. (The website Perl Monks is similar.) I see that people are posting code here, but I'm wondering if Ruby has a similar environment?

Second, the Perl Quiz of the Week is a fun way to test and improve your skills. I can always try it in Ruby, of course, but it would be great to see other Ruby solutions and analysis. Any Quiz-like material in Ruby land?

My final question is about Ruby itself. I'm working my way through Programming Ruby, which I believe covers Ruby 1.6 or so. I've brought my installation up to the current 1.8.1 though. Is there place I can read about what's changed since then?

Thanks for you time.

James Edward Gray II

This is my first post here and I just started learning Ruby a few days
ago, so forgive me if I sound a little ignorant. That said, I do have
some questions...

I come from Perl land and I'm wondering about some similar resources
that I valued there.

Welcome!

First, there is an excellent mailing list called Perl Beginners, where
coders learning the ropes post code they need help with and get tips
from the pros. (The website Perl Monks is similar.) I see that people
are posting code here, but I'm wondering if Ruby has a similar
environment?

This is the place. You'll find all levels of discussion here. And Nuby
questions tend to get quality answers quickly.

Second, the Perl Quiz of the Week is a fun way to test and improve your
skills. I can always try it in Ruby, of course, but it would be great
to see other Ruby solutions and analysis. Any Quiz-like material in
Ruby land?

Interesting idea. I think the closest we have is the occasional coding
challenge, put out by whomever feels up to it.

My final question is about Ruby itself. I'm working my way through
Programming Ruby, which I believe covers Ruby 1.6 or so. I've brought
my installation up to the current 1.8.1 though. Is there place I can
read about what's changed since then?

Our beloved _why offers:
  http://www.whytheluckystiff.net/articles/rubyOneEightOh.html

T.

···

On Tuesday 24 August 2004 09:32 pm, James Edward Gray II wrote:

--- James Edward Gray II <james@grayproductions.net>
wrote:

This is my first post here and I just started
learning Ruby a few days
ago, so forgive me if I sound a little ignorant.
That said, I do have
some questions...

Welcome to the ruby community

I come from Perl land and I'm wondering about some
similar resources
that I valued there.

One resource is a cpan like database
(currently only over 100 packages, its expanding
quickly)

http://rpa-base.rubyforge.org/wiki/wiki.cgi

Second, the Perl Quiz of the Week is a fun way to
test and improve your
skills. I can always try it in Ruby, of course, but
it would be great
to see other Ruby solutions and analysis. Any
Quiz-like material in
Ruby land?

Interesting idea. Don't know of any ruby related.

My final question is about Ruby itself. I'm working
my way through
Programming Ruby, which I believe covers Ruby 1.6 or
so. I've brought
my installation up to the current 1.8.1 though. Is
there place I can
read about what's changed since then?

Besides _why(the crazy looney funny ruby programmer)'s
site, there will be a new edition of the Programming
Ruby book out soon.

···

Thanks for you time.

James Edward Gray II

----------------------------------------
-- Name: David Ross
-- Phone: 865.539.3798
-- Email: drossruby [at] yahoo [dot] com
----------------------------------------

__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

T. Onoma wrote:

This is my first post here and I just started learning Ruby a few days
ago, so forgive me if I sound a little ignorant. That said, I do have
some questions...

I come from Perl land and I'm wondering about some similar resources
that I valued there.

Welcome!

Ditto.

You'll find some handy pointers here:

Also, a new edition of Programming Ruby is due quite soon. It covers 1.8, as well as topics not in the first edition.

In the meantime, this site may help bridge the gap:

http://phrogz.net/ProgrammingRuby/

It links an online copy of the first edition of Programming Ruby (AKA The Pickaxe Book) with wiki pages detailing changes in 1.8

James Britt
ruby-doc.org

···

On Tuesday 24 August 2004 09:32 pm, James Edward Gray II wrote:

Welcome!

Thank you. I'm enjoying this new world I'm exploring so far...

Our beloved _why offers:
  http://www.whytheluckystiff.net/articles/rubyOneEightOh.html

Exactly the kind of link I wanted! Thanks much.

James Edward Gray II

···

On Aug 24, 2004, at 9:40 PM, T. Onoma wrote:

Okay, this is a helpful link, but I found this there:

"Deprecate:

  • symbol variables ($1 etc)
  • regexp in conditional expression
  • range (../...) in conditonal expression
  • print with no argument == print $_
  (But these things are still around in Ruby 1.8, why would you suggest deprecating them? -- because Matz has said they will be deprecated in future versions. You can't deprecate them arbitrarily in the book, but you can call them out as not-future-proof.)"

Wow. That shocked me. Sounds like I better rethink some of the things I've been learning. Let me ask some clarifying questions here:

" • symbol variables ($1 etc)"

This one will kill me. <laughs> I'm very used to handling my substitutions this way, being a Perl guy. Can I get an example of "The Ruby Way" to do a search and replace without these, please?

" • regexp in conditional expression"

Does this mean something like:

if /Ruby/
  # ...
end

is not future-proof? What is the correct fix?

if $_ =~ /Ruby/
  # ...
end

" • range (../...) in conditonal expression"

I don't use this too often, but it can be a handy shortcut in places. Any reason this is considered bad? I'm just curious. Really, I guess I mean that question to apply to the whole list above.

I'm assuming it's because what's going on in these situations isn't always immediately obvious to readers of code. If that's the case though, I have to say I disagree with the $1..$9 call. That's a regex standard and downright handy. It will be missed, by me at least.

Thanks.

James Edward Gray II

···

On Aug 24, 2004, at 10:01 PM, James Britt wrote:

Also, a new edition of Programming Ruby is due quite soon. It covers 1.8, as well as topics not in the first edition.

In the meantime, this site may help bridge the gap:

Programming Ruby

It links an online copy of the first edition of Programming Ruby (AKA The Pickaxe Book) with wiki pages detailing changes in 1.8

" • symbol variables ($1 etc)"

This one will kill me. <laughs> I'm very used to handling my
substitutions this way, being a Perl guy. Can I get an example of "The
Ruby Way" to do a search and replace without these, please?

[...]

I'm assuming it's because what's going on in these situations isn't
always immediately obvious to readers of code. If that's the case
though, I have to say I disagree with the $1..$9 call. That's a regex
standard and downright handy. It will be missed, by me at least.

No, it's *not* a regex standard. It's a Perl standard. Regex
"standard" is \1, \2, etc. for backreferences. Look at "ri MatchData"
and you'll begin to see the Object behind a Regexp result -- and
that's the Ruby Way to do it.

-austin

···

On Wed, 25 Aug 2004 23:09:00 +0900, James Edward Gray II <james@grayproductions.net> wrote:

On Aug 24, 2004, at 10:01 PM, James Britt wrote:

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

I think I'd rather phrase that as "that's _a_ Ruby way to do it." 90% of the time, I personally find $1 and friends far more convenient, and use Regexp#match only when I need the match results to be long-lived.

Cheers

Dave

···

On Aug 25, 2004, at 9:17, Austin Ziegler wrote:

No, it's *not* a regex standard. It's a Perl standard. Regex
"standard" is \1, \2, etc. for backreferences. Look at "ri MatchData"
and you'll begin to see the Object behind a Regexp result -- and
that's the Ruby Way to do it.

True enough. I personally rarely use $1 and friends, but that's just
the way that I program. Are $1 and friends being phased out over time,
though?

-austin

···

On Wed, 25 Aug 2004 23:57:31 +0900, Dave Thomas <dave@pragprog.com> wrote:

On Aug 25, 2004, at 9:17, Austin Ziegler wrote:

> No, it's *not* a regex standard. It's a Perl standard. Regex
> "standard" is \1, \2, etc. for backreferences. Look at "ri MatchData"
> and you'll begin to see the Object behind a Regexp result -- and
> that's the Ruby Way to do it.

I think I'd rather phrase that as "that's _a_ Ruby way to do it." 90%
of the time, I personally find $1 and friends far more convenient, and
use Regexp#match only when I need the match results to be long-lived.

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

Austin Ziegler <halostatue@gmail.com> writes:

···

On Wed, 25 Aug 2004 23:57:31 +0900, Dave Thomas <dave@pragprog.com> wrote:

I think I'd rather phrase that as "that's _a_ Ruby way to do it." 90%
of the time, I personally find $1 and friends far more convenient, and
use Regexp#match only when I need the match results to be long-lived.

True enough. I personally rarely use $1 and friends, but that's just
the way that I program. Are $1 and friends being phased out over time,
though?

require 'tastes_may_differ'

I certainly hope not. One of the reasons I chose Ruby over Python for
my automated test harness was that regexes in Python are far too
complicated and verbose for my taste, whereas in Ruby, they're simple
and easy, with $1-style variables.

-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
    -- Blair Houghton.