in reply to Another golf style?

Great idea! I'd love to pick up more techniques on optimising my code. This would be really valuable to me, and a lot of others here I'm sure, and a lot of the techniques would be immediately applicable to work.

I'm not so interested in the obfuscated perl as, although it is cool, I have to write maintainable code and my co-workers aren't experts (basically I don't want to get into 'bad' habits).

Judging it will be hard as machines/os's will vary in speed, floating point efficiency etc. Shortest version means it currently is pretty easy to work out the winner, does it work and how long is it?

Maybe some use of benchmarking contrasting the versions on your own PC?

Replies are listed 'Best First'.
Re: Re: Another golf style?
by Brovnik (Hermit) on May 18, 2001 at 21:21 UTC
    A variant of the Test:Harness should be able to do this. If submitteers just provide the snippet of code, then the harness can do all the timing, generate statistics and ensure common test files, etc.
    There are also some subtleties between improvements in speed derived from better algorithms and those derived from implementing the same algorithm better.

    For example one race could be "Write a fast quicksort routine", vs. "write a fast sort routine". In the first case, the winner will be the one who programs the algorithm best, in the latter case it will be the one who comes up with the algorithm best suited to the data.

    In some cases, whether the test data is given with the challenge will be important to the outcome.

    Re: machine variations: I wouldn't expect the machine variation to matter as much as the algorithm / coding variation. I.e. the fastest algorithm one one machine is likely to be the fastest on any machine.
    --
    Brovnik.