[Development] QDateTime addDays logic
Giuseppe D'Angelo
giuseppe.dangelo at kdab.com
Thu Dec 13 16:15:44 CET 2018
Il 13/12/18 15:55, Edward Welbourne ha scritto:
>> Not saying it's correct, just stating the fact that function name is
>> confusing and potentially problematic because it doesn't do what it
>> states it does.
> Aye, there's plenty that isn't perfect, especially in old APIs. None
> the less, the Qt project makes strong backward-compatibility promises;
> part of the price of that is that we don't lightly change APIs, even
> when they aren't ideally named.
Probably part of the confusion is the fact that it's called "addDays",
not "daysAdded" or something like that. In Qt, APIs that use the present
imperative usually modify the object itself, while the ones in the past
simple return a new modified object (e.g. QString::trimmed).
My 2 c,
--
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4007 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20181213/b68801af/attachment.bin>
More information about the Development
mailing list