Discussion:
Ruby compared to other languages...
Matt Todd
2006-09-12 22:10:50 UTC
Permalink
Is it possible to have equivalent example blocks of code for the languages?
I'd be willing to submit a few...

cities = %w[ London
Oslo
Paris
Amsterdam
Berlin ]
visited = %w[Berlin Oslo]

puts "I still need " +
"to visit the " +
"following cities:",
cities - visited


vs...


$cities = array("London",
"Oslo",
"Paris",
"Amsterdam",
"Berlin");
$visited = array("Berlin", "Oslo");

print "I still need" .
"to visit the " .
"the following cities: \n" .
implode("\n", array_diff($cities, $visited));


Yeah, it is ugly, isn't it?

M.T.
Gavin Kistner
2006-09-12 22:49:34 UTC
Permalink
Post by Matt Todd
Is it possible to have equivalent example blocks of code for the
languages? I'd be willing to submit a few...
I understand the desire, but I would argue against it for three reasons:

1) Have you seen how little screen real-estate there is for code
snippets? There's barely enough for the Ruby code alone; no room for
putting a comparison in there.

2) Let's celebrate Ruby. Poking fun at other languages' syntax just gets
down in the mud.

3) I'd rather not potentially confuse a newcomer who _might_ see such
code from another language and say "Ewww, that's Ruby? Gross."
Matt Todd
2006-09-13 02:46:42 UTC
Permalink
Post by Gavin Kistner
1) Have you seen how little screen real-estate there is for code
snippets? There's barely enough for the Ruby code alone; no room for
putting a comparison in there.
That's addressed by the relatively short lengths of the code (taking
the front-page samples, for instance) and displaying Ruby first and
then the secondary language, second.
Post by Gavin Kistner
2) Let's celebrate Ruby. Poking fun at other languages' syntax just gets
down in the mud.
Actually, I meant no fun by it, but a real-world comparison of how
Ruby compares to others. For instance, in the previous example, you
see how Ruby treats things as objects, but PHP decidedly does not.
Post by Gavin Kistner
3) I'd rather not potentially confuse a newcomer who _might_ see such
code from another language and say "Ewww, that's Ruby? Gross."
If they are at these pages already, I believe that they are already in
tune with a comparison and will look at the labels if they have
troubles clarifying. I may be giving our readership too much credit,
but the sheer fact that they are on the page that they are on is
because they are curious. I think it's good that we go over the
different philosophical et al differences, but I don't think it's
enough unless we actually _show_ them a tiny sample of what's
different.

M.T.
James Britt
2006-09-13 03:00:32 UTC
Permalink
Post by Matt Todd
Post by Gavin Kistner
2) Let's celebrate Ruby. Poking fun at other languages' syntax just gets
down in the mud.
Actually, I meant no fun by it, but a real-world comparison of how
Ruby compares to others. For instance, in the previous example, you
see how Ruby treats things as objects, but PHP decidedly does not.
Yeah, but these things always end poorly, and no one comes out looking
good, no matter the intentions.
--
James Britt

http://www.ruby-doc.org - Ruby Help & Documentation
http://www.artima.com/rubycs/ - The Journal By & For Rubyists
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
Matt Todd
2006-09-13 03:32:41 UTC
Permalink
Post by James Britt
Post by Matt Todd
Post by Gavin Kistner
2) Let's celebrate Ruby. Poking fun at other languages' syntax just gets
down in the mud.
Actually, I meant no fun by it, but a real-world comparison of how
Ruby compares to others. For instance, in the previous example, you
see how Ruby treats things as objects, but PHP decidedly does not.
Yeah, but these things always end poorly, and no one comes out looking
good, no matter the intentions.
If that's so, then shouldn't we avoid the "Ruby from other languages"
articles, like this one?
http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-php/

It sounds to me that you are against it.

M.T.
James Britt
2006-09-13 04:13:32 UTC
Permalink
Post by Matt Todd
Post by James Britt
Post by Matt Todd
Post by Gavin Kistner
2) Let's celebrate Ruby. Poking fun at other languages' syntax just gets
down in the mud.
Actually, I meant no fun by it, but a real-world comparison of how
Ruby compares to others. For instance, in the previous example, you
see how Ruby treats things as objects, but PHP decidedly does not.
Yeah, but these things always end poorly, and no one comes out looking
good, no matter the intentions.
If that's so, then shouldn't we avoid the "Ruby from other languages"
articles, like this one?
http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-php/
Depends. Longer articles have the opportunity to present a more
accurate assessment of a language's pros and cons, so it's less likely
to come off as a simplistic propaganda when offering substantial
practical information on doing similar tasks in different languages.

I don't remember enough PHP to say if that particular article is
balanced or not, though it seems pretty benign. It avoids an actual
code, so there's less chance someone will complain that the PHP code is
poorly written, or wrong, or deceptive, or whatever.

Short, one-off comparisons meant to portray one language as
better/cleaner/prettier than another (and that's really what this is
about) end up as flame wars.


In the end, it's distracting from the site and from Ruby.
--
James Britt

http://www.ruby-doc.org - Ruby Help & Documentation
http://www.artima.com/rubycs/ - The Journal By & For Rubyists
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
James Edward Gray II
2006-09-13 12:56:58 UTC
Permalink
Post by James Britt
I don't remember enough PHP to say if that particular article is
balanced or not, though it seems pretty benign.
We made a very big effort to keep this whole section non-offensive in
nature. It's intended as a guide to those familiar with other
languages, helping them learn the differences.

James Edward Gray II
Matt Todd
2006-09-13 13:46:34 UTC
Permalink
Post by James Edward Gray II
Post by James Britt
I don't remember enough PHP to say if that particular article is
balanced or not, though it seems pretty benign.
We made a very big effort to keep this whole section non-offensive in
nature. It's intended as a guide to those familiar with other
languages, helping them learn the differences.
Well, I disagree that what I suggest would be offensive (and, in fact, find
it pretty benign itself), but there's not much I can do about that. ;)

I guess we have to agree to disagree...

M.T.

James Edward Gray II
2006-09-13 12:52:51 UTC
Permalink
Post by James Britt
Post by Matt Todd
Post by Gavin Kistner
2) Let's celebrate Ruby. Poking fun at other languages' syntax just gets
down in the mud.
Actually, I meant no fun by it, but a real-world comparison of how
Ruby compares to others. For instance, in the previous example, you
see how Ruby treats things as objects, but PHP decidedly does not.
Yeah, but these things always end poorly, and no one comes out looking
good, no matter the intentions.
I agree, it feels like mud slinging to me. I know that's not
intended, but I believe it's best avoided for that reason.

James Edward Gray II
Loading...