Avoid abbreviations in variable, parameter, and method names to improve code readability and maintainability. Use descriptive identifiers that clearly indicate the purpose and content of what they represent.
Avoid abbreviations in variable, parameter, and method names to improve code readability and maintainability. Use descriptive identifiers that clearly indicate the purpose and content of what they represent.
Instead of:
// Abbreviated variable names
let spec = self.specialization;
let ctx = self.generic_context;
let ty = self.inferred_return_type();
let tvar = TypeVar(...);
Prefer:
// Descriptive variable names
let specialization = self.specialization;
let generic_context = self.generic_context;
let return_type = self.inferred_return_type();
let type_var = TypeVar(...);
Additionally:
infer_return_type()
not inferred_return_ty()
place_expr
not just expr
T_all
instead of just T
Descriptive names make code easier to understand at first glance and reduce the cognitive load required to comprehend complex logic.
Enter the URL of a public GitHub repository