Many validations in Apex are done simply because of a misunderstanding of the differences between null and empty. If you understand the differences well, you will write cleaner code.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Null, Validations, and Guard Clauses

  • Pablo Gonzalez

摘要

Many validations in Apex are done simply because of a misunderstanding of the differences between null and empty. If you understand the differences well, you will write cleaner code.