Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a standard naming convention for self-identifiers in F#?
    primarykey
    data
    text
    <p>Regarding F# self-identifier's as in:</p> <pre><code>type MyClass2 = let data = 123 member whateverYouWant.PrintMessage() = printf "MyClass2 with Data %d" data </code></pre> <p>The <a href="http://msdn.microsoft.com/en-us/library/dd233205.aspx" rel="nofollow noreferrer">F# class documentation</a> says:</p> <blockquote> <p>Unlike in other .NET languages, you can name the self identifier however you want; you are not restricted to names such as self, Me, or this.</p> </blockquote> <p>(The answer to the question <a href="https://stackoverflow.com/questions/5355334/what-are-the-benefits-of-such-flexible-self-identifiers-in-f">What are the benefits of such flexible &quot;self-identifiers&quot; in F#?</a> explains the possible usefulness of this.)</p> <p>My question is, is there perhaps an unofficial standard of what to name the self-identifier? That is, while there may not be a <em>prescriptive</em> convention, is there a <em>descriptive</em> convention of what are F# programmers doing in the wild? <code>this</code>? <code>x</code>? <code>self</code>?</p> <p><strong>Update</strong></p> <p>Well looks like this may get closed, but the answer to the other question is hardly an answer as it's just showing multiple options which I'm already aware of. I'm looking for a consensus. Also, that question was asked in 2009 and there might not have been a consensus at that time, while there may be one now.</p> <p>Also interesting is the book <a href="http://rads.stackoverflow.com/amzn/click/1430246502" rel="nofollow noreferrer">Expert F# 3.0</a> authored by Don Syme does not use a consistent self-identifier in the examples. Rather it seems to favor single letter self identifiers especially the letter <code>x</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload