+ 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?