http://www.perlmonks.org?node_id=589277


in reply to Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell)

StringBuilder was "faster"
Are people still suggesting that machine cycles represent the optimal metric of efficiency? Since I started programming in the 1980's people have been making that up hill argument. Isn't an extra $25 toward a better processor a great trade off against me having to maintain the first code sample above.

In short, to me faster must be measured in my time, not the computer's time. The vacuum tube days of catering to the time demands of the machines should, by now, be long gone.

Phil

  • Comment on Re: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)

Replies are listed 'Best First'.
Re^2: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)
by bibliophile (Prior) on Dec 12, 2006 at 15:30 UTC
    It also suffers from the sin of premature optimization...

    Do it the easy (and more maintainable) way first, and then find out if it is "too slow". You can always optimize later.

    (or, as you say, buy a faster processor :-)

    -- WARNING: You are logged into reality as root.
      this was totally useless, thanks for giving up my hopes!