[Development] RFC: Containers member functions for algorithm

Ch'Gans chgans at gna.org
Sat Mar 25 00:24:57 CET 2017


On 25 March 2017 at 07:00, Kevin Kofler <kevin.kofler at chello.at> wrote:
> Michael Winkelmann wrote:
>> The reason why STL is using free function is because it separates data
>> structures (aka containers) and algorithms.
>> A bad example what happens if you dont separate can be seen here:
>> https://www.imagemagick.org/api/Magick++/Image_8h_source.html
>>
>> ...and your data structure will be bloated with member functions.
>
> Why is that bad? It is convenient and object-oriented. Moving everything to
> freestanding functions goes against the principles of OOP.

"OO was hip in the 80s and 90s, but its time we moved beyond!".
>From http://www.boost.org/doc/libs/1_63_0/libs/graph/doc/faq.html
item 3, last paragraph.

I'm not advocating for free functions, i really hate them. I have been
working with boost graph recently and find this technique awful to
write, awful to read and counter intuitive. I hope Qt won't become
like boost.

Chris

>
> That said, even freestanding functions would be better than the current
> boilerplate myContainer.begin(), myContainer.end() copypasta.
>
>         Kevin Kofler
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list