the preprocessor is a great tool to reduce duplication and boilerplate.
People that don't like it generally just don't know how to use it.
People that don't like it generally just don't know how to use it.
#ifndef asdf
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
#endif
which obliterate tooling such as IDEs. Of course, this is a contrived example, but the preprocessor is just one big footgun, which offers no benefits over other ways of solving the problems you mentioned, such as constexpr and perhaps additional, currently unimplemented solutions.There are better tools for the functionality the C preprocessor attempts to provide. Other languages have module inclusion systems and very powerful macros that don’t have the enormous footguns of the C preprocessor.
Édit: to be clear, I think #embed is a fine idea; I’d use it and it would make my sourcebase cleaner in some places.