in reply to Re: Optimisation isn't a dirty word.
in thread Optimisation isn't a dirty word.

Ah, yes, thanks revdiablo. I too was getting sucked into the CPU cycle part of the optimization arguments. We all need to remember that there are several dimensions to optimization:

I'm sure I'm missing others, and flexability could arguably be part of the reusability 'dimension'.

-Scott

Replies are listed 'Best First'.
Re^3: Optimisation isn't a dirty word.
by Ovid (Cardinal) on Oct 25, 2005 at 21:07 UTC
Re^3: Optimisation isn't a dirty word.
by TGI (Parson) on Oct 27, 2005 at 02:28 UTC

    I almost always favor in order:

    1. maintenance and readability
    2. flexibility, generalization and reuse (if you have to do something twice, you'll need to do it 1000 times).
    3. space
    4. CPU cycles

    99% of the time the last two don't matter. Item 1 matters 99% of the time. Too much focus on generalization will cause you to either write a Turing complete language or never finish your project. Generally, some generality is good (heh).

    Readable, well organized code is much easier to tighten up speed or space than overly tweaked "great idea" and "nifty hack" laden code.


    TGI says moo