[Qt-interest] Regarding the macros in QT
Andreas Pakulat
apaku at gmx.de
Mon Jul 13 17:50:50 CEST 2009
On 13.07.09 18:14:02, Patric wrote:
> Hello all,
> I have some interesting question that I want to ask regarding macros.
> There are a lot of macros defined around QT, but as far as I know in C++ the use of macros is hightly uncommendable.
Such a general statement cannot be considered correct. You _always_ have
to look at the specific circuumstances.
> Here is a quotation from "The C++ programming language" from it's creator : "Almost every macro demonstrates a flaw in the programming language, in the program, or in the programmer." .
>
> What do you think ? I'm just curious abot that.
Well, some of the macro's demonstrate a flaw in the programming
language, some of them demonstrate a flaw in (some of) the compilers
support by Qt. Few if any demonstrate flaws in Qt's own code or the
people working on it.
Some of them are "historically grown", because at the time of creating
some of Qt's subsystems (like signals/slots) there really was no way to
do it other than by using the macro's and breaking such important
subsystems by switching to something completely different (like
templates) would throw off every Qt user.
That said, most of the macro's aren't doing anything magic, they're just
hiding the ugly details.
Andreas
--
You are a very redundant person, that's what kind of person you are.
More information about the Qt-interest-old
mailing list