[Development] Notes on QtCore session @ QCS2016

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Tue Sep 6 17:35:45 CEST 2016


Il 06/09/2016 17:10, Kevin Kofler ha scritto:

> I think it was a mistake to remove -no-stl to begin with, and that Qt API 
> should not be littered with ugly std:: APIs, not just for ABI reasons, but 
> also for API (consistency) reasons.

Having APIs which follows the naming in the Standard Library has nothing
to do with the discussion at hand.

It's also proven that:

1) they allow C++ developers to see Qt as a less foreign land
2) they allow Qt classes to be used with other APIs (say, run algorithms
written for the STL over them)
3) they don't pose any extra maintenance burden (as they would just
forward the call to the Qt-ish API)

So please do not derail this sub-topic. The subject at hand here is
using Standard Library datatypes in our public API.


> Why can't Qt continue to offer better Q* equivalents as it has always done? 

1) BECAUSE. THEY. ARE. NOT. BETTER. In so many cases they're actually
far worse (hi, algorithms!). Can we please stop having this discussion
over and over again?

2) Because there are countless things for which you can't escape from
using the Standard Library: how can you possibly implement things like
std::is_enum? How can you handle initializer lists? (And yes: we need
all of that).

3) Because nobody wants to spend time to properly reimplement
non-trivial things like std::function, when we have a fully working
std::function we could just use. And we need std::function in many
places in our public API. Rinse and repeat for the other cases.

And before you think of "let's make a simplified std::function, which
will be 'simpler' for the user to use, and 'simpler' for us to
implement", please read

https://www.kdab.com/goodbye-q_foreach/#comment-158485


> What benefit does it bring to users to deprecate nice APIs for less nice 
> ones just because the latter are part of the compiler?

Nobody is talking about this -- on the contrary, we even considered
offering convenience classes. Say, a std::vector subclass which adds
append() and isEmpty().

-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
KDAB - The Qt 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/20160906/e67536fc/attachment.bin>


More information about the Development mailing list