Should I write a book on Python Metaprogramming ?

David Mertz mertz at gnosis.cx
Mon May 5 15:23:52 EDT 2003


|> the idea of writing a book called _Metaprogramming in Python_.

Michael Hudson <mwh at python.net> wrote previously:
|Here's a convenient place to plant a small rant: I object somewhat to
|the notion of Metaprogramming being something special performed by
|wizards with pointy hats and keepers of secrets.

In general, I thank all those who have provided helpful ideas on the
potential book.  And those who have warned against writing it, perhaps
even more-so :-).  I'm still not sure what I'll do, or when... but it is
interesting to read the thread.

The is something interesting in Hudson's comment, and something similar
in one by Andrew Cooke.  Even though I probably did say something about
"advanced programmers" in my note, I think of the contrast between
metaprogramming versus programming as mostly orthogonal to the contrast
beginner vs. advanced.

In my mind, metaprogramming is just one area of programming, just like
databases, or GUIs, or numeric analysis, or etc. are areas.  Mind you, I
don't think metaprogramming is quite a good topic for a very first
programming course.  But "meta" doesn't -per se- mean "more complicated,
more advanced."

In that sense, I think Cooke's comment that combinatorial HOFs aren't
metaprogramming (to those familiar with FP) is a bit off base.  HOFs are
possibly the very best example of metaprogramming.  That is, they take
things (functions) that programmers write at a first level, then
manipulate those programmatic things to create new programs (combined
functions).  The familiar HOF function 'compose()', for example, isn't
particularly -complicated-, but it -is- quite distinctly "meta."

Yours, David...

--
mertz@  | The specter of free information is haunting the `Net!  All the
gnosis  | powers of IP- and crypto-tyranny have entered into an unholy
.cx     | alliance...ideas have nothing to lose but their chains.  Unite
        | against "intellectual property" and anti-privacy regimes!
-------------------------------------------------------------------------






More information about the Python-list mailing list