Naming convention (programming): Difference between revisions

Content deleted Content added
Letter case-separated words: ; changed "Pascal case", to "PascalCase", to reflect context (i.e., camelCase -> twoWords; PascalCase -> TwoWords), the table entry (defines "PascalCase"), and the practical usage in languages that encourage the format (e.g., Pascal, Visual Basic , et cetera).
Idarwin (talk | contribs)
m Start section on dart/flutter.
Line 184:
 
Any identifier name may be prefixed by the commercial-at symbol (<code>@</code>), without any change in meaning. That is, both <code>factor</code> and <code>@factor</code> refer to the same object. By convention, this prefix is only used in cases when the identifier would otherwise be either a reserved keyword (such as <code>for</code> and <code>while</code>), which may not be used as an identifier without the prefix, or a contextual keyword (such as <code>from</code> and <code>where</code>), in which cases the prefix is not strictly required (at least not at its declaration; for example, although the declaration <code>dynamic&nbsp;dynamic;</code> is valid, this would typically be seen as <code>dynamic&nbsp;@dynamic;</code> to indicate to the reader immediately that the latter is a variable name).
 
===Dart/Flutter===
 
In the [[Dart_(programming_language)|Dart]] language, used in the [[Flutter_(software)|Flutter SDK]], the conventions are similar to those of Java,
except that constants are written in lowerCamelCase.
Dart imposes the syntactic rule that non-local identifiers beginning with an underscore (<code>_</code>) are treated as private
(since the language does not have explicit keywords for public or private access).
Additionally, source file names do not follow Java's "one public class per source file, name must match" rule,
instead using snake_case for filenames.<ref>{{Cite web | url=https://dart.dev/guides/language/effective-dart/style | title=Effective Dart - the Dart Style Guide}}</ref>
 
===Go===