code style/efficiency question: text file templates

jerf at jerf at
Sun Aug 4 05:29:20 CEST 2002

On Sat, 03 Aug 2002 16:15:00 -0500,  wrote:

> Saving femtoseconds isn't critical, but I'd like to get some real
> programmers' views on which is better and maybe learn some higher
> principle.

The "real programmer's view" is: Do it. Preferably the way that is easiest
to use over time. (i.e., easiest to program if simply writing the program
dominates time spent. easiest to use if using the program (as in changing
templates) dominates time spent). If it works fast enough, party hardy and
move on.

It will be challenging for you to write this slowly enough for it to run
excessively slowly, so don't sweat if you don't need to.

Now, if you DO need to, don't guess. Profile the code, find the slow
parts, and work on speeding those up. Guessing is bad because it's pretty
much impossible to guess where your code is slow... even if you really,
really think you know.

More information about the Python-list mailing list