The following conventions of spelling and terminology apply to the manuals, web pages, comments, and (except where they require spaces or hyphens to be used) function and variable names, although consistency in user-visible documentation and diagnostics is more important than that in comments and code. Also don’t forget that the Code Reference is auto-generated from the code. The following table lists some simple cases:
In DocBlock comments use the straight single quote (') or the straight double quote ("). In strings, which are visible to users, use curly quotes: The opening single quote (‘), the closing single quote (’), the opening double quote (“), and the closing double quote (”).
See also Butterick’s Practical Typography.