Book

Hello all,

I am a C++ and Java developer and I would like to have a look at ruby in my
spare time.

I prefer reading a book to reading online docs (when possible) and I usually
get bored when the book/tutorial is too slow paced.
I was thinking about "Programming Ruby" but the reviews seem to suggest it's
just a reference for language features. However, looking at the TOC it would
appear to be also suitable as a first book on Ruby and it's only 400 pages.

What do you think?

Many years ago I bought "Learning Perl" only to realise a couple of days
later, when I finished the book, that I needed to buy already "Programming
Perl" as Learning Perl was a good introduction, but was very very limited.
Starting with Programming Perl would have not been ideal as it's a 1000+
pages reference book (but a wonderful read!). Maybe a "Learning Perl for
experienced programmers" would have been the best way to start.

So, I am a bit skeptic about buying "Learning Ruby" as I do not like to
spend money on a book that lasts me 2 days, on the other hand I do not want
to buy a book that is not suitable for people with not prior experience in
the language (even if they are experienced developers).

For now I am more interested in the language than in Rails, so I would try
and avoid Ruby on Rails books, but if you think the best introduction to
Ruby is a part of a Ruby on Rails book, then I would could consider one.

Thanks in advance,

Tommy

P.S. sorry if this is a FAQ, but new books come out every day anyway, so a
FAQ on this topic might get out of date soon...

Tommy wrote:

I am a C++ and Java developer and I would like to have a look at ruby in my spare time.

I prefer reading a book to reading online docs (when possible) and I usually get bored when the book/tutorial is too slow paced.
I was thinking about "Programming Ruby" but the reviews seem to suggest it's just a reference for language features. However, looking at the TOC it would appear to be also suitable as a first book on Ruby and it's only 400 pages.

What do you think?

That's "The Pickaxe Book" - it's a good read. The free version will learn you Ruby - all you need to know - and the thick for-pay version is the reference to the language's standard library. Get that if you start coding an application.

Many years ago I bought "Learning Perl" only to realise a couple of days later, when I finished the book, that I needed to buy already "Programming Perl" as Learning Perl was a good introduction, but was very very limited.

My first impression of Perl - which lasted over several years of using it -
is that its author, Larry Wall, must be a very fast & accurate typist.

Ruby has a minimal definition that leads to extremely expressive programs. You really don't need to read very much to start using it, and the rest is learning how to Google for snapshots of Ruby libraries in action. No book can replace that.

For now I am more interested in the language than in Rails, so I would try and avoid Ruby on Rails books, but if you think the best introduction to Ruby is a part of a Ruby on Rails book, then I would could consider one.

Look up the expression "Domain Specific Language".

···

--
   Phlip

I was thinking about "Programming Ruby" but the reviews seem to suggest it's
just a reference for language features. However, looking at the TOC it would
appear to be also suitable as a first book on Ruby and it's only 400 pages.

With the library reference it's about 900p (3rd ed). The ruby part
alone is about 400p. I like it although *cough* some cross-references
could be slightly *cough* more precise in the pdf beta version. (But
maybe it's just me.) The 1st edition is freely available on the
internet but this refers to ruby 1.6. The 3rd edition is for ruby19.

"The Ruby Programming Language" is co-authored by the creator of ruby
himself. It has received some good reviews too. I haven't read it
though.

About a year ago I bought the Pickaxe and the Ruby Cookbook, and
together they seem to answer most of my questions. I'm also learning a
lot from the Ruby Forum (whilst exposing my ignorance to the world,
albeit under a pseudonym). :slight_smile:

The point of the Cookbook is that, even if I already know how to solve a
problem in another language, it helps me to learn the Ruby way of doing
things -- which is sometimes quite different from what I'm expecting.
YMMV!

Dave

···

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

Although I have over a dozen Ruby books (always looking for "the killer"
book), I highly recommend one of my latest acquisition:

*The Ruby Programming Language*
By: *David Flanagan & Yukihiro Matsumoto*

This is a new book that covers Ruby 1.9.

When I purchased the above book, I also purchased:

Beginning Ruby: From Novice to Professional (Beginning from Novice to
Professional)<http://www.amazon.com/Beginning-Ruby-Novice-Professional/dp/1590597664/ref=pd_bbs_sr_2?ie=UTF8&s=books&qid=1215346842&sr=1-2&gt;by
Peter Cooper
I am very satisfied with this book also.

Of course I also have all the tradition Ruby books: Programming Ruby, The
Ruby Way, Etc.

I hope this help!

Victor

···

On Sun, Jul 6, 2008 at 7:56 AM, ThoML <micathom@gmail.com> wrote:

> I was thinking about "Programming Ruby" but the reviews seem to suggest
it's
> just a reference for language features. However, looking at the TOC it
would
> appear to be also suitable as a first book on Ruby and it's only 400
pages.

With the library reference it's about 900p (3rd ed). The ruby part
alone is about 400p. I like it although *cough* some cross-references
could be slightly *cough* more precise in the pdf beta version. (But
maybe it's just me.) The 1st edition is freely available on the
internet but this refers to ruby 1.6. The 3rd edition is for ruby19.

"The Ruby Programming Language" is co-authored by the creator of ruby
himself. It has received some good reviews too. I haven't read it
though.

I am a C++ and Java developer and I would like to have a look at
ruby in my spare time.

Always nice. The more C++/Java people that know ruby at least, the
higher the chance Ruby gains more smart people ("smart" in the way
as so much "experienced and knowledgable" in general, not so much
about being a "genious". I think everyone can learn ruby, no matter
how "smart" or "not so smart" one is, I just wanted to emphasize on
the technical knowledge aspect part.)

I prefer reading a book to reading online docs (when possible)

I feel similar although I think in the not so distant future we
might really embrace other technologies. I actually prefer paper
for many reasons - my eyes like paper more, I can mark parts
with colours, emphasize other parts, scribble things down quickly,
am independent of a computer as well... In general I love
paper. (Poor them trees, but alas they grow back ;> )

However I do also store knowledge in a non-paper format, and
this has a few other advantages. I can search a lot faster for
it, I can rearrange the look and feel rather easily, and
reassemble the content quite easily too. I hope one day I
can combine both, maybe not on paper, but on something that
is flexible enough. :slight_smile:

I think by far the best ruby book is the Pickaxe. Personally I can
not recommend any other ruby book. I think there simply are not
enough ruby books. Yes, we have a collection of many scripts
in the ruby cookbook, but I did not find it as useful as the Pickaxe
back then.

Maybe a "Learning Perl for experienced programmers" would
have been the best way to start.

I guess so, but the more one learns, the less one can learn from
a specific book. It will normally target a bigger audience.

I think, honestly, the best way is to just write ruby code in
order to learn Ruby. With irb one can easily go through Hash,
Array and Strings and learn all these basic operations.
Enumerator is important too. I think thats it mostly.

Designing simple classes is super-easy as well, and does not
require a lot of boilerplate code. I think writing a SMALL
game is a good idea, like tic-tac-toe or some other game.
(I made my first ruby game too big, i started it 5 years ago...
i added a lot of features too quickly, and although it has only
4000 lines of ruby code, I got too bored to actually finish it... :frowning:
but I learned from this endeavour. )

So, I am a bit skeptic about buying "Learning Ruby" as I do
not like to spend money on a book that lasts me 2 days,

Then don't :wink:
I did not buy it and I think it is perfectly fine to write
ruby without having lots of books.

For now I am more interested in the language than in Rails, so
I would try and avoid Ruby on Rails books, but if you think
the best introduction to Ruby is a part of a Ruby on Rails book,
then I would could consider one.

I bought that "Agile Rails" book... I am not sure if it is good
or bad, because I have not finished it :frowning:
I think i will not finish it .... maybe I can use it as a reference
but compared to Pickaxe, I really hardly have any use for it.
(And I do not use the Pickaxe that much anymore, though I plan to buy
the latest one once its in print-format. I dont like pdf's, I enjoy
spending less time in front of the PC and reading a book is still
so much nicer than reading on my monitor)

Ruby has a minimal definition that leads to extremely
expressive programs. You really don't need to read
very much to start using it, and the rest is learning
how to Google for snapshots of Ruby libraries in
action. No book can replace that.

I agree basically with that. The best way to really learn Ruby
is by:

- writing ruby code, even if it is easy
- sometimes look into the other people's code (it might be
hard to understand, but there will come a time when it is no
longer really that difficult to understand.)

You just have to embrace that sometimes things can be
super-terse and short in Ruby.

···

--
Posted via http://www.ruby-forum.com/\.

Hi --

···

On Sun, 6 Jul 2008, phlip wrote:

Tommy wrote:

For now I am more interested in the language than in Rails, so I would try and avoid Ruby on Rails books, but if you think the best introduction to Ruby is a part of a Ruby on Rails book, then I would could consider one.

Look up the expression "Domain Specific Language".

And since this is "Link To Something Other Than Wikipedia!" Week,[1]
here's a starting point: http://homepages.cwi.nl/~arie/papers/dslbib/

David

[1] http://tinyurl.com/66nu4t

--
Rails training from David A. Black and Ruby Power and Light:
   Intro to Ruby on Rails July 21-24 Edison, NJ
   Advancing With Rails August 18-21 Edison, NJ
See http://www.rubypal.com for details and updates!

What do you mean, I have created a couple of them using Antlr, I think I
know what a DSL is, but I am not sure what you mean... (maybe because I am
not familiar with Rails).

Tommy

···

"phlip" <phlip2005@gmail.com> wrote

For now I am more interested in the language than in Rails, so I would
try and avoid Ruby on Rails books, but if you think the best introduction
to Ruby is a part of a Ruby on Rails book, then I would could consider
one.

Look up the expression "Domain Specific Language".

Ooops, I am realising now my mistake... I meant "The ruby programming
language" not programming Ruby. I confused myself by thinking about Learning
Perl and Programming Perl (O'really).

Tommy

···

"ThoML" <micathom@gmail.com> wrote

I was thinking about "Programming Ruby" but the reviews seem to suggest
it's
just a reference for language features. However, looking at the TOC it
would
appear to be also suitable as a first book on Ruby and it's only 400
pages.

With the library reference it's about 900p (3rd ed). The ruby part
alone is about 400p. I like it although *cough* some cross-references
could be slightly *cough* more precise in the pdf beta version. (But
maybe it's just me.) The 1st edition is freely available on the
internet but this refers to ruby 1.6. The 3rd edition is for ruby19.

"The Ruby Programming Language" is co-authored by the creator of ruby
himself. It has received some good reviews too. I haven't read it
though.

Tommy wrote:

Look up the expression "Domain Specific Language".

What do you mean, I have created a couple of them using Antlr, I think I know what a DSL is, but I am not sure what you mean... (maybe because I am not familiar with Rails).

Rails contains several very good examples of DSLs invented _within_ the base language. (If your base language can't do that, complain to the management!)

For example, here's the ActiveRecord required to query all posts in the Marvel forum written by some dude:

   class Forum < ActiveRecord::Base
     has_many :posts
   end

dudes_posts = Forum.find_by_name('Marvel').posts.find_by_author('some dude')

The goal of a DSL is you can read that statement, from left to right, and it sounds like (admittedly fractured) English.

ActiveRecord rewards this readability by packing two SELECT statements into one Ruby statement, and by declaring Forum.has_many :posts in one DRY location. ("Don't Repeat Yourself.") Raw SQL is also a DSL, but it's bound to performance, so it forces you to repeatedly redeclare the relation between Forums and Posts.

You can do a lot of Ruby without Rails, but Rails and its documentation contain many state-of-the-art examples of Ruby in action.

···

--
   Phlip

Thanks for the clarification.

···

"phlip" <phlip2005@gmail.com> wrote

...
You can do a lot of Ruby without Rails, but Rails and its documentation
contain many state-of-the-art examples of Ruby in action.

Hi --

Tommy wrote:

Look up the expression "Domain Specific Language".

What do you mean, I have created a couple of them using Antlr, I think I know what a DSL is, but I am not sure what you mean... (maybe because I am not familiar with Rails).

Rails contains several very good examples of DSLs invented _within_ the base language. (If your base language can't do that, complain to the management!)

For example, here's the ActiveRecord required to query all posts in the Marvel forum written by some dude:

class Forum < ActiveRecord::Base
   has_many :posts
end

dudes_posts = Forum.find_by_name('Marvel').posts.find_by_author('some dude')

The goal of a DSL is you can read that statement, from left to right, and it sounds like (admittedly fractured) English.

I don't think DSL's are obliged to be any more like English than any
other L's are :slight_smile: I believe Jim Weirich uses the example of chess
notation, which is a DSL and is certainly arcane if you don't have the
specialized background for it. That's OK; domains are specialized, so
there's no reason DSL's shouldn't be. There's nothing about domain
specificity, per se, that militates for wide comprehensibility. It's
more often a matter of giving specialists the communication tools that
they need and that the ambient natural language doesn't offer.

There's also the contrast between creating a Domain Specific Language
and simply using domain-specific language.[1] find_by_name is an
expressive method name, but I don't think it's part of an identifiable
language (other than Ruby I mean :slight_smile:

David

[1] http://dablog.rubypal.com/2007/4/17/the-l-in-dsl-langue-ou-langage

···

On Sun, 6 Jul 2008, phlip wrote:

--
Rails training from David A. Black and Ruby Power and Light:
   Intro to Ruby on Rails July 21-24 Edison, NJ
   Advancing With Rails August 18-21 Edison, NJ
See http://www.rubypal.com for details and updates!