[Development] Question about QCoreApplicationData::*_libpaths

André Somers andre at familiesomers.nl
Tue Jan 19 12:53:35 CET 2016



Op 19/01/2016 om 13:15 schreef Marc Mutz:
> On Tuesday 19 January 2016 11:13:16 Harri Porten wrote:
>> On Tue, 19 Jan 2016, Marc Mutz wrote:
>>>> I think we agree that std containers are in many cases faster than the
>>>> Qt containers. But they are harder to use and especially developers
>>>> that come from other languages often appreciate the ease of use of the
>>>> Qt containers.
>>> I always cringe when I hear this. What, specifically, do you mean by
>>> "easier to use"?
>>>
>>> No-one, not even experts understand QList, really. So it may appear to be
>>> easy to use, but is actually a container only absolute experst should
>>> use.
>> What kind of 'understanding' are you expecting? I'd say that every Qt
>> beginner, the biggest greenhorns, 'understand' absolutely enough to use
>> the class. And yes: that view might be incomplete and non-optimal in
>> regards to performance or in some extreme cases.
>>
>> And anyone coming from a Java, JavaScript or whatever background easily
>> finds such Qt classes documented next to the others. And appreciates e.g.
>> a consistent API style. You may not personally like it but this individual
>> matter of tastes cannot be fully fulfilled in a project with that many
>> contributors and users.
> I was referring to the fact that references into the container either do get
> invalidated upon, say, appending, or they are not, depending on the memory
> layout. That is a very important (to know about, not to have) property of a
> container. One that should be either true or false, and not, as for QList,
> depend on, among other things, the processor's word width. ETOOSUBTLE.
Yet many developers, even green ones, have managed to write some pretty 
nice software using the container. Perhaps that feature is not used as 
much as you think it is? Or only by people who actually understand the 
class at your level of understanding or something close to it, while for 
all others it works just fine?

I am not denying that there are issues with the Qt containers, and with 
QList in particular. I think you made some very valid points on that 
front. I just wonder if the problem is really so big that it needs 
taking down the complete Qt container library and the massive source 
breakage that will cause.
>
> The STL also has a consistent API style. But that wasn't my point here. But
> since you've mentioned it: no, I definitely don't see a need for first() and
> last() if there's front() and back(). Or count() instead of size(). Actually,
> count() is against Qt API design guidelines, because it is also a verb, and
> nothing is counted here. That would be an O(N) operation.
>
> And if API consistency makes QVector have a prepend(), and QHash::iterator
> have it + n, something got out of hand...
>
Why shouldn't QVector have a prepend? Because it is not very fast to do 
that?

André




More information about the Development mailing list