Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule: Do not use lists on start_link/3,4 and init/1 #329

Open
elbrujohalcon opened this issue Jan 9, 2024 · 3 comments
Open

Rule: Do not use lists on start_link/3,4 and init/1 #329

elbrujohalcon opened this issue Jan 9, 2024 · 3 comments
Labels

Comments

@elbrujohalcon
Copy link
Member

Name

No Init Lists

Brief Description

The idea is to avoid code like this one…

-module my_server.
% …exports and everything else…
start_link(AParam) ->
  gen_server:start_link(?MODULE, [AParam], []).

init([AParam]) ->

Reasoning

See this thread in the forums

Refactoring Proposal

Use maps, tuples, or… if you need to ignore the parameter at all, use an atom like undefined or no_argument.

@paulo-ferraz-oliveira
Copy link
Collaborator

Should this be a default rule?

@elbrujohalcon
Copy link
Member Author

If I'm the one with the final vote, I say yes!! But what do you think?

@paulo-ferraz-oliveira
Copy link
Collaborator

I'm Ok with that. I think it's otherwise misleading, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants