Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split 'this.'-hint for methods and fields #79

Open
Shinigami92 opened this issue Mar 28, 2017 · 1 comment
Open

Split 'this.'-hint for methods and fields #79

Shinigami92 opened this issue Mar 28, 2017 · 1 comment

Comments

@Shinigami92
Copy link

Some coding-guidelines suggest that you prefix fields with this. but not methods (at least in Java)
http://checkstyle.sourceforge.net/config_coding.html#RequireThis

@JustGregory-zz
Copy link

I would be fine with separating it into two hints, although in any case it doesn't affect my coding as I'm not concerned with checkstyle.

Just personally, I'd much rather have code written so that this. is never used. The only time I see it in use, is prefixing a class field with this and being assigned in a setter method or constructor by a parameter named the same thing. In my case, I've always refactor-renamed the parameter to one or two letters and removed the "this." prefix. I don't think methods need the "this." prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants