I agree that using macros in a C++ code is a bit awkward but wxWidgets was desigend far before the advanced C++ language features.
Yes, they are using this well-known excuse for many years now. I think it is quite a lame excuse, if you will padon my saying so.
It's like saying "Yeah I know asbestos causes lung cancer, but I don't care because I built my house before that was discovered".
I mean, seriously, what kind of an exuse is that...
It is true that macros have a good use. Sometimes, rarely, but yes they do.
However, there is simply no excuse, except being plain ignorant or lazy (or both), why someone would insist on writing DEFINE_BLAH(SomeClass) instead of deriving from a base template.
I would not mind if the answer was "yeah sorry, we know about it, but we did not have the time to fix it". But the (transliterated) answer "hey, we were here first, screw those
art nouveau C++ features" is not satisfying.
The same is true for macros like
XRCID and
XRCCTRL, and many others.
They are not only unnecessary and unsafe, some of them are strictly speaking illegal, as they call a macro from inside a macro. As it happens, it (accidentially) still works, but only if the order of inclusion is done correctly (...and is that a good thing?).
Another example:
How many programmers have fallen for
wxMessageBox and
wxMessageDialog! The former returns
wxOK, but the latter returns
wxID_OK, which are, as it happens, different numeric values. Fair enough, they are different constants, but they look similar enough so they can be easily confused. What happens? Nothing. No error, no anything... except your program does not work as expected.
If constants like these were typed as
enums, then the compiler would not allow you to make such a mistake at all. That's why compilers are so pedantic, it really helps to avoid stupid errors.
I agree that it is absolutely not trivial to implement such massive changes on a huge thing like wxWidgets. However simply saying "hey, it's been like that for 20 years" is not good.