in reply to Re: Re^2: Matching First Character of Strings Efficiently (benchmarking)
in thread Matching First Character of Strings Efficiently

Perl Golfing is not an unmixed blessing. But most people are smart enough to realize that golfed solutions aren't usually the best choice when writing code that you care about.

Unfortunately, many people seem to think that nano-optimized code is the best choice when writing code that you care about. You reinforce this yourself above.

So, we get people spending way too much time thinking about and arguing about whether they should use substr or ord and then spreading the joy by nano-optimizing other things and in the end they spend an extra 4 hours on their code so that it runs 0.002 seconds faster (yet the total run time is 2.4 seconds).

It'd be much better if people chose the code that was clear or easy to maintain.

Just look at how much time has been wasted by people trying to replace s/x//g with tr.

The cult of nano-optimization is a seductive one. This is why several people have very strong aversion to micro-/nano-optimization.

- tye        

  • Comment on Re^4: Matching First Character of Strings Efficiently (nano-opt)