6 answers
One return type that was not mentioned...If you assign the results of a SQOL to a single object and SOQL finds no results, the return type is NULL.If you aren't aware of this and you aren't doing a NULL check on the results, it can cause a "derefrencing a null value" exception. It is best just to avoid the trouble and always return a list (with a size() or isEmpty() check).