[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Learning the fine points of Ruby

Ari Brown

7/20/2007 4:33:00 PM

Hey all,
I adore Ruby. I love everything about it. The debugging, the
community, the syntax....

But my code sorta looks like VBScript - simple and generic. I have
seen some really great Ruby code - some I can understand, others I
just can't wrap my mind around. But how do you learn to think like that?

Can anyone recommend a book or site that teaches you to write Ruby
succinctly and rubily?

thanks,
aRi
--------------------------------------------|
If you're not living on the edge,
then you're just wasting space.



5 Answers

Morton Goldberg

7/20/2007 4:52:00 PM

0

On Jul 20, 2007, at 12:32 PM, Ari Brown wrote:

> Hey all,
> I adore Ruby. I love everything about it. The debugging, the
> community, the syntax....
>
> But my code sorta looks like VBScript - simple and generic. I have
> seen some really great Ruby code - some I can understand, others I
> just can't wrap my mind around. But how do you learn to think like
> that?

By reading and writing lots of Ruby code.

> Can anyone recommend a book or site that teaches you to write Ruby
> succinctly and rubily?

I know you have participated in Ruby Quiz, but have you really
explored James' Ruby Quiz web site which makes a huge amount of
interesting code available for you to read? It may be just what
you're looking for.

Regards, Morton

Mike Mondragon

7/20/2007 5:28:00 PM

0

On 7/20/07, Morton Goldberg <m_goldberg@ameritech.net> wrote:
> On Jul 20, 2007, at 12:32 PM, Ari Brown wrote:
>
> > Hey all,
> > I adore Ruby. I love everything about it. The debugging, the
> > community, the syntax....
> >
> > But my code sorta looks like VBScript - simple and generic. I have
> > seen some really great Ruby code - some I can understand, others I
> > just can't wrap my mind around. But how do you learn to think like
> > that?
>
> By reading and writing lots of Ruby code.
>
> > Can anyone recommend a book or site that teaches you to write Ruby
> > succinctly and rubily?
>
> I know you have participated in Ruby Quiz, but have you really
> explored James' Ruby Quiz web site which makes a huge amount of
> interesting code available for you to read? It may be just what
> you're looking for.
>
> Regards, Morton
>
>


Read the PickAxe book, read it for 15 to 30 minutes per day.
http://www.pragmaticprogrammer.com/titles/ruby/...

Force yourself to live on the command line with the 'irb' and 'ri'
tools (PickAxe talks about this). Avoid a GUI for coding and use vi
or emacs (during this period a GUI will make you dumb).

And if you are into Rails about two or three months later read the
Ruby appendix in the Agile book.

Then read the PickAxe book again about 12 months later.

Participate in your local Ruby group, find yours here:
http://ruby...
Start a group if one is not in your proximity.

Write your first gem, use hoe because it will make it really easy for
you to publish it.
http://seattlerb.rubyforg...

Lloyd Linklater

7/20/2007 5:58:00 PM

0

Mike Mondragon wrote:
> Read the PickAxe book, read it for 15 to 30 minutes per day.
> http://www.pragmaticprogrammer.com/titles/ruby/...


Excellent advice. To that I might add "The Ruby Way" as a great source.

http://www.amazon.com/Ruby-Way-Second-Addison-Wesley-Professional/dp/0672328844/ref=sr_1_1/103-4385456-5079837?ie=UTF8&s=books&qid=1184954192&...

--
Posted via http://www.ruby-....

Giles Bowkett

7/20/2007 10:39:00 PM

0

I think "The Ruby Way" is the original poster's best bet in terms of
writing idiomatic Ruby. It's very much about writing Ruby that looks
like Ruby, as opposed to other languages, and that was definitely a
core part of the original question.

Another way to do it is to get the source code for a package like
Rails or Rake or RSpec or really anything nifty and useful and use
that code as a sort of combined puzzle and style guide. Figure out how
existing packages do things, and emulate them.

--
Giles Bowkett

Blog: http://gilesbowkett.bl...
Portfolio: http://www.gilesg...

Joon You

10/27/2007 1:45:00 PM

0

On 2007-07-20 12:32:32 -0400, Ari Brown <ari@aribrown.com> said:

> Hey all,
> I adore Ruby. I love everything about it. The debugging, the
> community, the syntax....
>
> But my code sorta looks like VBScript - simple and generic. I have
> seen some really great Ruby code - some I can understand, others I
> just can't wrap my mind around. But how do you learn to think like that?
>
> Can anyone recommend a book or site that teaches you to write Ruby
> succinctly and rubily?
>
> thanks,
> aRi
> --------------------------------------------|
> If you're not living on the edge,
> then you're just wasting space.

Ruby Way by Hal Fulton is the book you need. I, too came from C# and
VB and this book really helped me tremendously.