|
|
От: |
thesz
|
http://thesz.livejournal.com |
| Дата: | 26.05.09 14:50 | ||
| Оценка: | 19 (1) | ||
Yes, you can use macros to enable extremely high level of code reuse, effectively 100% (if theres any kind of pattern in your code, you can write a macro to encapsulate that). But it also means that you're effectively defining your own DSL, and then writing your program in that — and when someone else needs to understand and maintain your code, they'll have to figure out that DSL first.
This isn't really fundamentally different from plain function/class libraries (they are also DSLs), but the expressivity of macros is so much higher than plain function calls (even with Smalltalk/Ruby style blocks and other such facilities) — and, consequently, so is their complexity.