Regarding the F # self-identifier, as in:
type MyClass2 = let data = 123 member whateverYouWant.PrintMessage() = printf "MyClass2 with Data %d" data
F # class documentation :
Unlike other .NET languages, you can name the identifier self as you want; You are not limited to names such as self, Me, or this.
(The answer to the question, What are the advantages of such flexible "self-identifiers" in F #, explains the possible usefulness of this.)
My question is: is there perhaps an unofficial standard for what to call a self-identifier? That is, although there may not be a prescriptive agreement, is there a descriptive agreement on what F # programmers do in the wild? this ? x ? self ?
Update
It looks good that this may close, but the answer to another question is unlikely to be the answer, as it just shows a few options that I already know about. I am looking for consensus. In addition, this question was asked in 2009, and at that time there might not have been consensus, although it may be now.
Also interesting is the Expert F # 3.0 book by Don Sime, which does not use a consistent self-identifier in the examples. Rather, it looks like single letter identifiers, especially the letter x .
User
source share