vscode-java-code-generator
vscode-java-code-generator copied to clipboard
Require this in getters
I would prefer the usage of this in getter code generation:
public int getWidth() {
return this.width;
}
Could this be an option?
I dont know, but it generates my getters with "this" and I would prefer getter without "this" :D Maybe there could be some option to turn on or off "this" in getters?
for best practices it's not preferred in normal getters.
for best practices it's not preferred in normal getters.
there is no set "best practice" for getters and setters, but I'd say it would make it clearer where that variable came from. Especially glancing over the thing without knowing exactly which fields are in the class, it'd be very helpful to at least know that the field being gotten belongs to this.