[Development] Use of Standard Library containers in Qt source code

Benjamin TERRIER b.terrier at gmail.com
Sat Jul 2 17:34:06 CEST 2016


2016-07-02 16:30 GMT+02:00 Stephen Kelly <steveire at gmail.com>:
> Benjamin TERRIER wrote:
>
>> But how come a raw loop can be excluding? It should be understandable by
>> any C++ developer and, I would dare to say, by any C-style programming
>> language developer.
>
> I don't think anyone can understand or reason about raw-loop-heavy code (see
> PS below). I use 'excluded' to refer to people who are not willing to do so.
> They exclude themselves from working on Qt code because they can not reason
> about it.
>
> In the same sense, Thiago is 'excluded' from reading and understanding code
> which uses 'container.empty()' or which doesn't use raw-loops, because he
> would choose to not work on such code.
>
> There is a divide. The 'exclusion' is self-decided.
>
> Does that make sense? If you have a better phrase than 'self-exclusion' for
> that then it could be useful to share it.

Ok for me if you meant it this way.

> Someone unwilling to attempt to reason about the code in that function is
> 'excluded' from fixing something in it or extending whatever features it
> has.

I'd boldly reply to that that if one is unwilling to reason about a
piece of code, one should not be fixing it.
But I'd also agree that the code should be as readable as possible to
get a many developers to contribute.

Back to Qt current situation I think that the lack of comments in some
parts is a bigger throwback than
the code style.

And back to the actual topic of Qt/STL containers, I am for option 3
if the project can afford the
extra development and maintenance otherwise I'd go with option 4.

Br,

Benjamin Terrier



More information about the Development mailing list