4 ms·
> A sane language already includes plenty of standard functions, but that doesn't relieve the need for more. The difference is that I write new functions on a
by adwn 6y ago
> A sane language already includes plenty of standard functions, but that doesn't relieve the need for more.
The difference is that I write new functions on a daily basis, while I almost never need new control flow constructs. And if it turns out that such a construct would be useful, then it's almost always better to also have syntax and compiler support for it (for error checking, more descriptive parser errors, optimizations).
- mschaef 6y agoAt least in my experience, macros are really an escape hatch of last resort, and for the reasons you mention. Semi-related: http://www.mschaef.com/defmacro-coupling http://www.mschaef.com/defmacro-coupling
- zeveb 6y ago> The difference is that I write new functions on a daily basis, while I almost never need new control flow constructs. I wonder if perhaps you only think you rarely need new control flow constructs because you are using languages without good support for macros. Where a Lisp or Tcl programmer might just code up a true DSL (cf. CLOS or the condition system), perhaps you just write functions, never realising how much more readable and understandable your systems could be.