From: "Choi, Junegunn" Date: 2009-02-19T02:10:58+09:00 Subject: Re: Newbie - several array questions > > As long as you realize that inject() is always the most inefficient > solution possible. > Can you elaborate on your claim? How inefficient, like, by orders of magnitude? Is it serious enough to affect the overall performance of a typical ruby application? In a situation like this, I'd prefer the code which uses 'inject', since it shows the intention of the programmer more clearly and concisely, while the performance penalty - 10% in my naive experiment - is irrelevant in this case. I agree that we should be aware of the performance issues even when we're dealing with a high-level language such as ruby, but your bold statement makes me feel that you're trying to 'defend' your own code against the others in some kind of a code contest. -- junegunn.