Apex Anti-Patterns
Do not keep unused code
Do not hardcode IDs
// Bad - hardcoded Record Type ID
if (account.RecordTypeId == '0120000000001ABC') {
// logic here
}
// Bad - hardcoded User ID
if (UserInfo.getUserId() == '0050000000001XYZ') {
// logic here
}Do not hardcode credentials
Last updated
Was this helpful?