Open beyzasgnms opened 3 months ago
I agree, since "get" has several meanings, we should be selective for prefixes. We can also consider properties and computed properties besides functions, they should not have "get" prefix too imo.
Earlier version of this document has that logic. Actaully we choose it with team. I think existing rules should be stay. For example this one.
By the way, if you removed everything from the previous rules, we will talk about these topics again. I think this will make us waste time. Like this issue, we already agreed on that :D
Since this rule was part of the previous guide and not existing in our guide, Workgroup will re-review existing rules by considering your comments next week and let you guys know about the action, thanks for your feedbacks 🙌🏻
A short summary of issue: Using
get
in function names can lead to ambiguity and reduce the clarity of the function’s purpose. It often doesn’t convey the full action or result expected from the function.Reasoning and motivation: Using descriptive names instead of get helps to better communicate the function’s role and behavior. For instance,
fetchUser()
orretrieveUser()
are more descriptive and suggest that some action beyond simply returning a value is being performed. This practice enhances code readability and maintainability, making it easier for developers to understand and work with the code.Sources: I reviewed Airbnb and Kodeco style guides but couldn’t find an example of this guideline. However, it was included in our previous code style guide.