Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've generally found that C/C++ macros make debugging harder. Debuggers don't always deal with debugging them the most straightforward thing.

That's because quasiquote and similar operators let you debug code, not code that generates code.

What I've found is that you can debug the generated code to debug the code generator. Code generators shouldn't be used to do something terribly complicated. I'd agree with you that code generators doing complicated things is a code smell. Leave those to native syntax, provided it's not as badly thought out as templates.



> C/C++ macros

I'd argue that those aren't first class macros. C macros are just source manipulators, and C++ templates (I'm not super experienced with them so forgive come if I'm way off) don't really manipulate the AST, it's more a type system with compile time resolution.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: