News for hackers. Stuff that matters.
Re:Stupid Smart Pointers in C by dima55 on Monday March 17, 2025 @11:20PM (#43395436)
X macros can do tons of stuff C++ can't. And if you stick with C, you avoid mountains of C++ problems, even with all the stuff you're talking about.
Re:Stupid Smart Pointers in C by salgernon on Tuesday March 18, 2025 @12:11AM (#43395678)
I love using x macros with c++ to create static types and hooks to disambiguate from basic types. This is more applicable to final executables than libraries - I would never provide anyone with an API based on the mess it creates, but it allows application code to be strongly checked and makes it really easy to add whole classes of assertions to debug builds.
Re:Stupid Smart Pointers in C by torlok on Tuesday March 18, 2025 @08:38AM (#43398695)
I never said X macros are bad on their own. With C++ you can code exactly as you would in C, but you don't have to manually implement C++ features when there's a need. C++ doesn't have any more problems than C, it's programmers who abuse language features that creates problems.