4 ms·
your comment has the tone of this being an elegant solution, but it reads to me like an awful hack. typeless macros are a nightmare I never want to deal with ag
by 38 2y ago
your comment has the tone of this being an elegant solution, but it reads to me like an awful hack. typeless macros are a nightmare I never want to deal with again.
- eschaton 2y agoThese are very straightforward and do in fact serve as an elegant solution.
- smackeyacky 2y agoElegant maybe in the 1980s before compilers got properly complicated. Now they’re a weird anachronism. I’m old enough to have worked on c++ when it was a precompiler called cfront and let me tell you trying to work out whether your macro was doing something weird or the cfront processor did something weird was very frustrating. I swore off macros after that.
- eschaton 2y agoThis is a case where you’re seeing the word “macro” and reacting to that when it’s really not warranted. It’s not using macros for complicated code generation, just selecting from a couple alternatives based on one or two possible compiler arguments. I’m also old enough to remember CFront and this isn’t that.
- ykonstant 2y agoI am not an expert in these things, but the discussion here reminds me of https://news.ycombinator.com/item?id=41182917 https://news.ycombinator.com/item?id=41182917
- eschaton 2y agoAnd yet it shouldn’t because it’s not and doesn’t need to be anywhere near that degree of complexity. This is exactly the sort of thing I mean when I said the previous respondent was reacting to the use of the term ‘macro’ rather than their actual complexity.