Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dancinllama/db092429aec6a95452b6 to your computer and use it in GitHub Desktop.
Save dancinllama/db092429aec6a95452b6 to your computer and use it in GitHub Desktop.
Keep thy code stupid simple (KISS) - bad example
public boolean isTrue(boolean myBool){
if(myBool){
return true;
}else{
return false;
}
}
public Map<Id,Contact> getContactMap(){
Map<Id,Contact> contactMap = new Map<Id,Contact>();
List<Contact> contacts = [Select Id From Contact];
if(contacts != null && contacts.size() > 0 && !contacts.isEmpty()){
for(Integer i=0; i < contacts.size(); i++){
contactMap.put(contacts.get(i).Id,contacts.get(i));
}
}
return contactMap;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment