[Interest] The willy-nilly deletion of convenience methods (was: Mixing Commercial and Open...)

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Wed Mar 24 12:17:02 CET 2021


On 22/03/2021 17:19, Thiago Macieira wrote:
> I thought we'd fixed that and reverted them. Or didn't we add toContainer?
> 
> Peppe, what was our final conclusion here?

There was no conclusion reached, unfortunately, and didn't manage to 
provide a replacement in time. I was (and still am) afraid at simply 
reintroducing .to<Container>() functions.

One reason is purely API quality: implementing them "correctly" in 
C++14/17 without ranges/concepts is not exactly funny (just look at the 
ranges::to proposal for how many corner cases are there to consider), 
and there's indeed already ranges-v3::to as the ready-made solution (so 
why spending time redoing it).
Given a half-cooked solution wouldn't be acceptable into QtCore, we'd 
need to put it somewhere else where we could be more flexible in terms 
of minor API breaks if we think we did a mistake, and we didn't find the 
right place. (KDToolBox comes to mind, eventually).

The other reason was more profound and related to the deprecation of 
these APIs, meaning that in the huge majority of usages found was a form 
of algorithmic abuse. Should we offer APIs which facilitate bad coding 
practices?

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: 4329 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210324/31c2f1ae/attachment.bin>


More information about the Interest mailing list