Names should clearly indicate their purpose, type, and behavior. This applies to methods, variables, and parameters. Choose names that are self-documenting and unambiguous.
Names should clearly indicate their purpose, type, and behavior. This applies to methods, variables, and parameters. Choose names that are self-documenting and unambiguous.
Key guidelines:
Example:
// Unclear naming
public function pan($value) { }
public function num($len = 6) { }
// Clear naming
public function formatPanNumber($value) { }
public function generateRandomInteger(int $digits = 6) { }
// Boolean method naming
public function arrayable($value) { } // Unclear purpose
public function isArrayable($value) { } // Clear purpose
This standard helps prevent confusion, makes code self-documenting, and maintains consistency across the codebase.
Enter the URL of a public GitHub repository