Ruby for programmers

Hi all

I’ve come across an online book concerning Ruby for Perl programmers but
I’ve yet to find any for other languages.

The Pick Axe book is a little to slow and simplistic telling far to many
of
the core fundamentals of programming OO in general.

I’d like a book that gives more of a conversion from one language set to
another. Pointing out idioms and syntactic differences.

A programmers Ruby guide/tutorial.

Does anyone know of anything that may help me in this?

All the best

Doug

On Mar 21, 2006, at 6:22 PM, Doug B. wrote:

I’d like a book that gives more of a conversion from one language
set to
another. Pointing out idioms and syntactic differences.

A programmers Ruby guide/tutorial.

Does anyone know of anything that may help me in this?

You may want to give Hal F.'s, “The Ruby Way,” a try. More
advanced material and includes chapters on moving to Ruby from Perl
and Python.

HTH,


Jason P.
[email protected]

“The key to performance is elegance, not
battalions of special cases.”

  • Jon Bentley and Doug McIlroy

Doug B. wrote:

I’d like a book that gives more of a conversion from one language set to
another. Pointing out idioms and syntactic differences.

A programmers Ruby guide/tutorial.

Consider:

http://www.onestepback.org/articles/usingruby/
http://www.waits.net/~swaits/LearnRubyTalk/learnruby.html

Pistos

On 22 Mar 2006, at 00:35, Jason P. wrote:

to many of
You may want to give Hal F.'s, “The Ruby Way,” a try. More
advanced material and includes chapters on moving to Ruby from Perl
and Python.

Curious; I found it was a lot less advanced, and gave far more rote
stuff I could find anywhere else (using abstract data types to
describe trees and stacks, etc). For the most part, I skimmed the
chapters and found almost nothing I didn’t already know. Ironically,
from my very limited exposure to Ruby, it didn’t at all hint at “the
ruby way”; it gave the feel of doing things very conventionally.

But then, the Pickaxe turned up at the same time as Ruby for me, and
together, they re-ignited my love of programming, so I probably have
an overly positive slant on it.

I wonder - perhaps the gaps in my generally c++ background was well
filled by the Pickaxe book, where as yours was well filled with The
Ruby Way?

Cheers,
Benjohn

On Thu, Mar 23, 2006 at 06:39:10AM +0900, Benjohn B. wrote:
[…]
} :slight_smile: Well, that was the Pickaxe for me, but you’ve already said you
} differ on that. … The reason I say that, is I came from a c++
} background (I like to think I’m reasonably capable at it too). While
} I never felt that c++ gave an especially good way of describing
} anything much (and I think OO is pretty limited, on the whole), it
} was still very helpful to read the Pickaxe and find out just how much
} I’d been missing out on.
[…]

I’ve said it before and I’ll say it again. C++ has duck typing. (It’s in
the templates.) It just happens at compile time instead of run time.
This
has some significant advantages, not least of which is that the compiler
can do a lot of static analysis of your code, allowing it to catch
errors
in code paths that runtime testing may not exercise.

C++ is good for a different class of problems than Ruby but if you don’t
think C++ is especially good for any purpose, or you even think that C++
is
exclusively OO, then you didn’t really know C++ that well and you didn’t
use it to its full potential.

–Greg

On 22 Mar 2006, at 22:29, Gregory S. wrote:

I’ve said it before and I’ll say it again. C++ has duck typing.
(It’s in
the templates.)

It’s not Ruby’s duck typing that makes me like it (I I agree with
your templating point). It’s Ruby’s libraries, its clean and simple
syntax, it’s pre-installedness on OS X, the standard profiler,
debugger, interactive shell, and documentation system that come out
of the box. It’s packaging system. I especially like irb - the shell.

that C++ is
exclusively OO, then you didn’t really know C++ that well and you
didn’t
use it to its full potential.

:slight_smile: I can only say I’m happy to have been spared that which I missed.

On 22 Mar 2006, at 00:22, Doug B. wrote:

I’d like a book that gives more of a conversion from one language
set to
another. Pointing out idioms and syntactic differences.

A programmers Ruby guide/tutorial.

Does anyone know of anything that may help me in this?

:slight_smile: Well, that was the Pickaxe for me, but you’ve already said you
differ on that. … The reason I say that, is I came from a c++
background (I like to think I’m reasonably capable at it too). While
I never felt that c++ gave an especially good way of describing
anything much (and I think OO is pretty limited, on the whole), it
was still very helpful to read the Pickaxe and find out just how much
I’d been missing out on.

On 3/22/06, Gregory S. [email protected] wrote:

I’ve said it before and I’ll say it again. C++ has duck typing. (It’s in
the templates.) It just happens at compile time instead of run time. This
has some significant advantages, not least of which is that the compiler
can do a lot of static analysis of your code, allowing it to catch errors
in code paths that runtime testing may not exercise.

C++ has very bad and almost unusable “duck-typing”. C++ is a
piss-poor object language and a mediocre generics language. The best
thing going for C++ is that it’s mostly C underneath.

And I know C++ reasonably well and have been trying to exercise C++ to
what should work:

struct ToString
{
ToString()
{
}

  template <class T>
  std::string operator()(const T::values& v)
  {
    return T::to_str(v);
  }

};

So far as I can tell, it doesn’t work. Without something like that
(where, ideally, T could either be a real class and we’re talking
about typedefs and static member functions inside the class or a
namespace), C++ can’t claim that it does “duck typing”, even at
compile time.

-austin

On Mar 22, 2006, at 7:47 PM, Austin Z. wrote:

  std::string operator()(const T::values& v)

-austin

What compiler are you using? I’m pretty sure I’ve gotten g++ to do
acrobatics like this in the past.