by smanek · 17y ago · 0 comments
But, for some inexplicable reason, Joel says "Don’t use macros to create your own personal programming language."
How is using macros to encapsulate common functionality any different than using functions to encapsulate common functionality? Both lead to less mental overhead, more code reuse, and code that's easier to parse.
Obviously, macros have almost nothing in common with functions. Macros are simply shorthand for code that will be literally placed at the spot they are called.
So rather than calling functions, with all argument expressions evaluated, and a call stack, and blah blah blah, you are just copy-pasting code without it actually ending up on the screen for a developer to see.
(I do understand the difference, for what it's worth. I worked as a professional Common Lisp coder for a while.)