extragear/multimedia/amarok/src/podcasts

Ian Monroe ian at monroe.nu
Wed Jul 25 05:54:47 CEST 2007


On 7/24/07, Martin Aumueller <aumuell at reserv.at> wrote:
> On Sunday 22 July 2007, Bart Cerneels wrote:
> > SVN commit 690980 by shanachie:
> >
> > Some improvements.
> >
> > Note: the Q_ASSERTS are here for debugging. I'll remove them when the code
> > is stable.
>
> IMHO, no need for removing them: it's a good way of documenting pre- and
> post-conditions. And probably the code is wrong anyway in some place if the
> assertion fails. And if the code is stable, it should get compiled
> with -DQT_NO_DEBUG, and then Q_ASSERT becomes a no-op.

Users do compile with debug on, so we shouldn't have asserts. Also we
don't provide binaries, so can't do any quality control for how they
are compiled. Like KUbuntu released all their KDE software for a
revision or two with asserts enabled.

I think a error() << is sufficient for documenting pre and post
conditions, and it makes you think about how to make your code more
resilient against other methods giving you bad stuff. Obviously
someone could write a short macro that worked just like a Q_ASSERT but
error()'ed with a line number instead of crashing the program.

Ian


More information about the Amarok-devel mailing list