3 ms·
Macros (and their more hygienic cousins) are not always a good idea. They make it very hard to understand what the rest of the program does, unless you can grep
by wisty 16y ago
Macros (and their more hygienic cousins) are not always a good idea. They make it very hard to understand what the rest of the program does, unless you can grep the whole thing. Lispers will violently disagree with me here.
Regarding decorators, no they don't seem to be that useful. They do bloat the documentation, if not the language; and you don't ever really need them.
- silentbicycle 16y ago> Macros (and their more hygienic cousins) are not always a good idea. They make it very hard to understand what the rest of the program does, unless you can grep the whole thing. So does object-oriented programming, more often than not. I'm not sure that's a sufficient argument, especially if there's no other way to do static metaprogramming in a language.
- baddox 16y agoThough decorators functional identically do just passing a function to another function which returns a function, the decorator syntax is uniquely useful. For framework like Django, it lets you "tag" a function with a single line at the top. I think this greatly enhances readability over the alternative.