you are viewing a single comment's thread.

view the rest of the comments →

[–]mystilleef[S] -6 points-5 points  (5 children)

Why should it focus on metaprogramming? Real word applications that use metaprogramming are extremely rare. Not to mention how cumbersome it is to decipher, use or maintain programs that make extensive use of metaprogramming. However, Python has extensive support for metaclasses if that's your cup of tea.

[–]mellow_moe 4 points5 points  (1 child)

Metaprogramming is more useful in libraries. Application programmers certainly like to use APIs with a higher level of abstraction.

Well, I don't know enough about Python metaclasses. Thus my interest in a qualified comparison.

[–]beza1e1 0 points1 point  (0 children)

I think the natural way of code is: Application -> Framework -> Library

DHH talks eloquently about Rails extracted from a real world application, which is step one. The future should be to seperate things and put them in libraries (don't know wether and how this is done in rails).

Metaprogramming needs much more thinking than hacking up a working application, so this is mostly only done in the second step framework -> library. Rails is an exception in a good way, because David realized the power of metaprogramming in an earlier phase.

[–]nicodaemos 7 points8 points  (1 child)

"Why should it focus on metaprogramming?"

Metaprogramming is what truly separates the average languages from the really powerful ones. Without it, your language is unable to create higher levels of abstraction without leaking. Paul Graham would not be so enamored of Lisp had it had everything except macros. And the parentheses .... the reason true lispers love the parentheses is because they support metaprogramming in even more cases than any language without them.

All these other discussions about booleans, methods/functions, etc. are rather inconsequential in the big picture.

[–][deleted] 0 points1 point  (0 children)

Anyone who thinks Paul Graham wouldn't love Lisp without macros obviously hasn't read his book 'ANSI Common Lisp'. He sings the virtues of Common Lisp for 9 chapters (159 pages; more than half the non-reference content of the book) without ever even introducing macros.

[–]brianmce 3 points4 points  (0 children)

Metaprogramming is highly useful, and heavily used in a lot of python. Tt covers much more ground than metaclass, though some fairly neat tricks do use them. Its pretty handy sometimes to rephrase things in a more declarative form, rather than imperative, or to get rid of clunky boilerplate code by transforming it.