Scott Meyer's argument that non-member functions increase encapsulation and provide a more elegant design (s) seems very true to me. See Here:
ArticleBut I have problems with that. (And it seems like others, especially library developers who usually completely ignore this)
The code usually looks better and more logical when I use member functions. This can be an acquired taste, although it takes some getting used to looking for algorithms first and then objects. (Shiver)
So maybe I have only one problem:
With me member functions And my IDE knows what a class can do.
This is huge for me! I do not use anything that does not support code completion of a member function for programming. In well-designed libraries, it completely replaces the documentation for me. And even if I looked at the api doc, looking at the list of members just felt completely natural, logical, and I can be sure that, well, this is the end. If there is no method, I can safely assume that it does not exist, and I can write my non-member friend.
I agree with this in STL, because, well, it makes sense to consider the algorithms separately from the basic components and because you get used to it.
I have not seen an IDE that could tell me which non-member functions work on a particular class.
And this is actually my question: Is there an IDE (or IDE function) that helps with this convention with the code?
source share