Hacker News new | ask | show | jobs
by ChadB 6335 days ago
Given the overall theme of this rant, I would assume that it's about keeping code close together and easy to understand.

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.

1 comments

You really think that macros have almost nothing in common with functions? Granted that the semantics are a little different but, in my mind, macros and functions are just two different tools that serve the same goal: allowing for code reuse.

(I do understand the difference, for what it's worth. I worked as a professional Common Lisp coder for a while.)

Well, I don't think he's talking about Common Lisp macros.
I assumed you did, I was honestly just trying to formulate my point. That, and I was talking about C++ macros, which is what Joel was referring to as well.