Skip to content

Add a rule of thumb to the guide. #13813

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

Merged
merged 1 commit into from
Sep 6, 2024
Merged

Conversation

RudolfMan
Copy link
Contributor

@RudolfMan RudolfMan commented Sep 6, 2024

This rule of thumb used to be in the getting started page, but it got dropped when moved to hexdocs, I'm not sure if it was intentional.

It was helpful to point new devs to the suggestion when onboarding to elixir.

A rule of thumb when to prefer using `and`, `or` and `not` over `&&`, `||` and `!`
Comment on lines +172 to +173
As a rule of thumb, use `and`, `or` and `not` when you are expecting booleans. If any of the arguments are non-boolean, use `&&`, `||` and `!`.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josevalim josevalim merged commit ad97f93 into elixir-lang:main Sep 6, 2024
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

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

Successfully merging this pull request may close these issues.

2 participants