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

Strict compare === at least in tests #235

Closed
Glutexo opened this issue Jun 2, 2024 · 1 comment
Closed

Strict compare === at least in tests #235

Glutexo opened this issue Jun 2, 2024 · 1 comment

Comments

@Glutexo
Copy link
Owner

Glutexo commented Jun 2, 2024

If I recall correctly, in JavaScript and PHP worlds, comparing strictly by default is considered good practice; loose comparison should be only used conciously to avoid type conversion. I am, however, not sure how this works in Elixir.

@Glutexo
Copy link
Owner Author

Glutexo commented Jun 2, 2024

Apparently, the strict equal === operator is only useful when comparing integers and floats. Other types are never equal if they are of different types. The strict comparison only adds a redundant type checking instruction.

See Structural comparison for more information on comparison in Elixir. Closing this issue as not required.

@Glutexo Glutexo closed this as completed Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant