Most Powerful Open Source ERP

Guideline Never Hardcode If Not Necessary

Hard code is hard to maintain.
  • Last Update:2017-04-05
  • Version:001
  • Language:en

Never Hardcode If Not Necessary

Hardcoded names or properties are hard to maintain and make code difficult to extend. Workflow state names for example should always use an accessor like shown below:

Good Examples:

if self.getSimulationState() in self.getPortalDraftOrderStateList():

Bad Examples:

if self.getSimulationState() == "draft":