[Vit-discuss] Ruby compared to other languages...

Matt Todd chiology at gmail.com
Tue Sep 12 18:10:50 EDT 2006


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/vit-discuss/attachments/20060912/1c541812/attachment.html 


More information about the vit-discuss mailing list