Just wanted to check if there are any cons to what I'm doing. Please feel free to comment.
When I pass variables to class functions I find it easier and less confusing to use the same names for the variables and for the class members they'll be assigned to, and then just using the this pointer to assign them. So for example, I'll have:
in class declaration:
class SomeClass
{
private:
...
class SomeClass
{
private:
QString userName;
...
To copy to clipboard, switch view to plain text mode
and then:
void SomeClass
::someFunction(const QString &userName
) {
this->userName = userName;
}
void SomeClass::someFunction(const QString &userName)
{
this->userName = userName;
}
To copy to clipboard, switch view to plain text mode
instead of using const QString &aUserName or usrName or nameOfUser or some other modified names, like some sources suggest.
It works fine, but maybe I'm missing something. Do you see any problem with this?
Bookmarks