Should I use «this.» keyword in OOP programing where it's possible to skip it? Any benifits of using it? [duplicate]

人盡茶涼 提交于 2019-12-11 05:48:39

问题


Possible Duplicate:
When do you use the “this” keyword?

In OOP sometimes we can write this.PropertyName = VALUE and sometimes we can skip this. and just write PropertyName = VALUE.

So my question is, should we try always to use this.? Does using / writing this have any effect on application performance or does it just make the code a little bit clearer?

Thanks.


回答1:


There shouldn't be any difference in performance. Its purely a style decision.



来源:https://stackoverflow.com/questions/3920279/should-i-use-this-keyword-in-oop-programing-where-its-possible-to-skip-it-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!