# Ruby for programmers

**URL:** <https://www.ruby-forum.com/t/ruby-for-programmers/85036>\
**Category:** Ruby\
**Created:** [March 22, 2006, 1:22am UTC](https://www.ruby-forum.com/t/ruby-for-programmers/85036 "2006-03-22T01:22:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@ashiro](https://www.ruby-forum.com/u/ashiro)\
**Post date:** [March 22, 2006, 1:22am UTC](https://www.ruby-forum.com/t/ruby-for-programmers/85036/1 "2006-03-22T01:22:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ashiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@ashiro](https://www.ruby-forum.com/u/ashiro)\
**Post date:** [March 22, 2006, 1:35am UTC](https://www.ruby-forum.com/t/ruby-for-programmers/85036/2 "2006-03-22T01:35:28Z")

</div>

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.  
removed\_email\_address@domain.invalid

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

- Jon Bentley and Doug McIlroy

---

<div class="post-metadata">

**Author:** ![ashiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@ashiro](https://www.ruby-forum.com/u/ashiro)\
**Post date:** [March 22, 2006, 5:41am UTC](https://www.ruby-forum.com/t/ruby-for-programmers/85036/3 "2006-03-22T05:41:45Z")

</div>

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.onestepback.org/articles/usingruby/)  
[http://www.waits.net/~swaits/LearnRubyTalk/learnruby.html](http://www.waits.net/~swaits/LearnRubyTalk/learnruby.html)

Pistos

---

<div class="post-metadata">

**Author:** ![ashiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@ashiro](https://www.ruby-forum.com/u/ashiro)\
**Post date:** [March 22, 2006, 10:39pm UTC](https://www.ruby-forum.com/t/ruby-for-programmers/85036/4 "2006-03-22T22:39:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ashiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@ashiro](https://www.ruby-forum.com/u/ashiro)\
**Post date:** [March 22, 2006, 11:29pm UTC](https://www.ruby-forum.com/t/ruby-for-programmers/85036/5 "2006-03-22T23:29:15Z")

</div>

On Thu, Mar 23, 2006 at 06:39:10AM +0900, Benjohn B. wrote:  
[…]  
} 🙂 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

---

<div class="post-metadata">

**Author:** ![ashiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@ashiro](https://www.ruby-forum.com/u/ashiro)\
**Post date:** [March 23, 2006, 12:28am UTC](https://www.ruby-forum.com/t/ruby-for-programmers/85036/6 "2006-03-23T00:28:14Z")

</div>

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.

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

---

<div class="post-metadata">

**Author:** ![ashiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@ashiro](https://www.ruby-forum.com/u/ashiro)\
**Post date:** [March 22, 2006, 10:39pm UTC](https://www.ruby-forum.com/t/ruby-for-programmers/85036/7 "2006-03-22T22:39:16Z")

</div>

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?

🙂 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.

---

<div class="post-metadata">

**Author:** ![ashiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@ashiro](https://www.ruby-forum.com/u/ashiro)\
**Post date:** [March 23, 2006, 1:47am UTC](https://www.ruby-forum.com/t/ruby-for-programmers/85036/8 "2006-03-23T01:47:08Z")

</div>

On 3/22/06, Gregory S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![ashiro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@ashiro](https://www.ruby-forum.com/u/ashiro)\
**Post date:** [March 23, 2006, 2:43am UTC](https://www.ruby-forum.com/t/ruby-for-programmers/85036/9 "2006-03-23T02:43:47Z")

</div>

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.
