Should I use, this, self or something else for sel

2020-02-12 13:30发布

My guess is that "this" is more C#-ish and in F# it's better to use "self".

Are there any required/preferred coding guidelines?

标签: oop f#
2条回答
何必那么认真
2楼-- · 2020-02-12 14:05

In many examples I've seen people are using just x. In my own code started with this, but now I usually do x, because IMHO it makes the code somewhat more readable

查看更多
够拽才男人
3楼-- · 2020-02-12 14:12

In addition to "this", "self", and "x", I have also seen "__" and "lowercaseenclosingclassname".

查看更多
登录 后发表回答