Apexに関するコーディング規約
イシュー
- 変数名の規約決め
参考
5.1 Rules common to all identifiers
Identifiers use only ASCII letters and digits, and in two cases noted below, underscores. Thus each valid identifier name is matched by the regular expression \w+ .
In Google Style special prefixes or suffixes, like those seen in the examples name_, mName, s_name and kName, are not used.
5.1 すべての識別子に共通するルール
識別子はASCII文字と数字のみを使用します。そして以下の2つの例ではアンダースコアも使用します。 したがって、それぞれ有効な識別子名は、正規表現「\W+」に一致します。
Googleのスタイル例に見られるような特殊な接頭辞や接尾辞である、name_ や mName や s_name や kName は、使用しません。
JavaStyleをベースにしたApexコーディング規約
参考
- bestpractice - Does an Apex or VisualForce code style guide exist? - Salesforce Stack Exchange
- salesforceStyleGuide/Apex style guide.md at master · PolarisProject/salesforceStyleGuide · GitHub
- Salesforce Development Best Practices
Lightning Design System
参考
ベストプラクティス的な記事
- Eclipseでコーディング規約のインデントやら空白やらを保存時に自動で修正する - 意識低いエンジニアの一念発起ブログ
- [salesforce]Force.comプログラミングのベストプラクティス集 – deferloader
- From the Wiki: Apex Design Patterns and Other Tips - Developer Relations
- https://developer.salesforce.com/forums/?id=906F00000009B6cIAE:tile