Forum: Ruby Ruby for programmers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
32ba8c5c148da2653028dc7f8066b810?d=identicon&s=25 Doug Bromley (ashiro)
on 2006-03-22 01:22
(Received via mailing list)
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
2899cec9af525f7953e19c8210aca97c?d=identicon&s=25 Jason Perkins (Guest)
on 2006-03-22 01:35
(Received via mailing list)
On Mar 21, 2006, at 6:22 PM, Doug Bromley 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 Fulton's, "The Ruby Way," a try. More
advanced material and includes chapters on moving to Ruby from Perl
and Python.

HTH,

--
Jason Perkins
jperkins@sneer.org

"The key to performance is elegance, not
  battalions of special cases."
  - Jon Bentley and Doug McIlroy
A402df36168b81b31c17adcbb5ae8cf4?d=identicon&s=25 Pistos Christou (pistos)
on 2006-03-22 05:41
Doug Bromley 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
Ffcb418e17cac2873d611c2b8d8d891c?d=identicon&s=25 Benjohn Barnes (Guest)
on 2006-03-22 22:39
(Received via mailing list)
On 22 Mar 2006, at 00:22, Doug Bromley 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.
Ffcb418e17cac2873d611c2b8d8d891c?d=identicon&s=25 Benjohn Barnes (Guest)
on 2006-03-22 22:39
(Received via mailing list)
On 22 Mar 2006, at 00:35, Jason Perkins wrote:

>> to many of
> You may want to give Hal Fulton'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
Bf6862e2a409078e13a3979c00bba1d6?d=identicon&s=25 Gregory Seidman (Guest)
on 2006-03-22 23:29
(Received via mailing list)
On Thu, Mar 23, 2006 at 06:39:10AM +0900, Benjohn Barnes 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
Ffcb418e17cac2873d611c2b8d8d891c?d=identicon&s=25 Benjohn Barnes (Guest)
on 2006-03-23 00:28
(Received via mailing list)
On 22 Mar 2006, at 22:29, Gregory Seidman 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.
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-03-23 01:47
(Received via mailing list)
On 3/22/06, Gregory Seidman <gsslist+ruby@anthropohedron.net> 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
E34b5cae57e0dd170114dba444e37852?d=identicon&s=25 Logan Capaldo (Guest)
on 2006-03-23 02:43
(Received via mailing list)
On Mar 22, 2006, at 7:47 PM, Austin Ziegler 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.
This topic is locked and can not be replied to.