function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HagridHagrid 

Coding Standards For Apex

I want to write some Apex coding standards for use by our development team.  I'm going to include traditional structured programming rules such as single exit points from code blocks, maximum line length so that code can be easily viewed in the editor provided by Salesforce etc.  I would also like to include Apex specific guidance, which is where I have difficulty (I'm not an experienced Apex developer).

 

Does anyone have, or know of, coding standards for Apex code that I could use?

HarmpieHarmpie

Generally APEX uses most Java coding standards, such as CapitalName for classnames, lowerCase syntax for variables.

 

APEX specific would be:

- No or minimum SOQL statements in a loop, use Maps

- No or minimum DML statements in a loop, use Lists

 

... more?