Should I write a book on Python Metaprogramming ?

Hung Jung Lu hungjunglu at yahoo.com
Mon May 5 09:18:29 EDT 2003


mertz at gnosis.cx (David Mertz) wrote in message news:<mailman.1052116867.22805.python-list at python.org>...
> Here's the story though:  For a number of months, I have had in mind the
> idea of writing a book called _Metaprogramming in Python_.  

My 2 cents.

I think if you can go one step beyond make some practical
justification of metaprogramming, that would be great. I mean, to
emphasize on why commercial software development would greatly benefit
from metaprogramming. Collect some examples that would explain on the
increase of productivity, shortening of development time, etc.

I have one example in mind. (I just posted something a few days ago.)
In many software development situations (like game programming,
web-related programming, UI programming, etc.), programmers are
terribly inefficient in traditional programming environments, where if
there is a bug, you have to restart the program. In many cases, the
setting up of the initial state is time-consuming. The programmers
waste time in setting up the initial state, instead of using that time
for fixing the code, and have their full attention and full time
looking at the problem spot. A better approach is not to stop the
program: once the objects and states are there, keep them in memory,
but replace the class implementation on the fly, and re-try from a
low-level loop around the problem spot. Ideally, it's possible to
develop an application in Python, without ever needing to restart the
application. If you could provide a pattern example on these types of
things, that'll be great.

I think Python itself is good, but still not great, for
metaprogramming or aspect-oriented-ish needs. Maybe Python still needs
to be improved? Manually inserting hooks is a bit painful in Python.

Hung Jung Lu




More information about the Python-list mailing list