-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Labels
suggestion of smellElixir-specific smells suggested by the communityElixir-specific smells suggested by the community
Description
Options should not drastically change the return type of a function. For example, you should not have an option that changes the return type. Fictional API:
Integer.parse("13")
=> {13, ""}
Integer.parse("13", discard_rest: true)
=> 13
Because options are optional and sometimes set dynamically, if they change the return type it may be hard to understand what the function actually returns. It is best to introduce a separate function, like Integer.parse_no_rest.
fishtreesugar, doomspork, lucasvegi, gabrielgiordan and tiagoefmoraes
Metadata
Metadata
Assignees
Labels
suggestion of smellElixir-specific smells suggested by the communityElixir-specific smells suggested by the community