On Fri, Jul 10, 2009 at 10:57, Matt Rogers<ma...@kde.org> wrote:
> I don't understand why you have 'const QDragMoveEvent*' pointers. IMO, the 
> const doesn't add any value.

Shouldn't you be always be using const unless there's a specific reason not to?

Without const, you have an implicit assumption that something isn't
modified.  Break the assumption, and you create a bug that has to be
found, tracked down, and properly fixed, possibly after it's already
caused user headaches.

With const, the assumption has been made explicit.  Break the
assumption, and the compiler complains at you up front. You avoid ever
creating the bug in the first place. It protects against mistakes, and
later mis-maintenance by programmers who have a brain-fart or don't
fully understand the code.

By itself, it doesn't make the code any more or less correct, but it
helps to guard against bugs, present and future.

-- Josh
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to