From: Josh Cheek Date: 2010-03-30T21:59:27+09:00 Subject: Re: Programming Language Comparison --00032556144e0efcfd048304337a Content-Type: text/plain; charset=ISO-8859-1 Another thing to consider is that Perl is being demerited for TIMTOWTDI, but Ruby is not. Yet how many ways are there to loop from 0 to 2 in Ruby? results = Array.new 3.times { |i| results << i } (0..2).each { |i| results << i } 0.upto(2) { |i| results << i } 0.step(2) { |i| results << i } (0..2).to_a.each { |i| results << i } for i in 0..2 do results << i end i = 0 while i <= 2 results << i i+=1 end i = 0 until i > 2 results << i i+=1 end i = 0 loop do results << i break if 2 < i+=1 end puts RUBY_VERSION results.join.scan /.../ do |result| puts result end There are also a few additional ways in Enumerable that aren't shown here b/c they don't work on 1.8.6 And I left out array based solutions, because while they will work in this small range, that is not what they are there for, and so will quickly become unmanageable. ie [0,1,2].each {} might work but is not scalable if you want to iterate the first hundred numbers, and is not dynamic if you want to be able to determine your range from variables. ----- And I don't know enough about Perl to answer this, but I'd be interested to know from anyone who does, whether Perl is actually difficult to read, or whether that is just a consequence of certain styles of coding that get the most attention or have become idiomatic within the Perl community. --00032556144e0efcfd048304337a--