Re: Coding standards proposal, usage of "this"

Simon Marchi via Gdb-patches
2021-08-16T17:01:15Z

>> - Use `this` when referring to a method of the current class.
>> Rationale: without `this, it's not clear that you are referring to a
>> method of the current class, versus a free function.
>
> I'm not really a fan of this, and I am also not aware of other
> projects using such a style. Since this makes calling member functions
> more verbose/uglier than calling free functions, this would also
> discourage member functions. Is there a need to distinguish these?

There's no *need*, of course. It's just based on my experience, I
remember seeing some function calls, wondering how it could even work
with the passed arguments. And then I realized it was a method call,
where `this` is passed implicitly.

Do you think it would discourage adding member functions, in opposition
to adding free functions? Or just leaving the code in-line, leading to
bigger methods?

Simon