Walton Hoops wrote:
> On 2/4/2010 7:46 PM, Mr Bubb wrote:
>> Marnen Laibow-Koser wrote:
>>    
>>> If you're so sure of that, why are you asking for help?  There may be no
>>> better way in Perl, but Ruby is not Perl. :)
>>>      
>> Is there a hidden camera, or something? It's not legit to say "I'm a
>> ruby newbie, is there a way to do x in ruby?" If I had said, hey perl
>> has one line comments, how do you do one line comments in ruby, would
>> you answer, well, why do you need one line comments? Jeez.
>>    
> No I wouldn't, if on the other hand you came to me and asked "How do you
> do write a 'for' loop in Ruby?"
> I would indeed ask "why do you need a 'for' loop?"  Why ask? Because
> while writing something akin to a 'for'
> is *possible* in Ruby, Ruby has other methods of achieving the same
> result which are preferred.  Thus,
> seeing as your original question has been dealt with by others, it makes
> perfect sense to ask _why_
> you would want to do something that just doesn't seem like the best
> _Ruby_ solution in most cases.

Well said.  If you want to get the most out of a language, it's worth 
investigating its idioms.  Sometimes they are not worth copying, but 
more often they are.  You can write Fortran in Ruby, or Lisp in C++, but 
usually you don't want to.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen / marnen.org
-- 
Posted via http://www.ruby-forum.com/.