On 05/14/2015 04:22 PM, Gijs Kruitbosch wrote:
"==" is not any less explicit than "===". Both versions have an exact, specified meaning.

They both have exact meanings. But people, especially new contributors new to JS, frequently use "==" without understanding the nuances and footguns involved. In Firefox OS/Gaia I think the emergent convention[1] is that you should always use "===" unless you have a specific need to use "==" and in that case you should have a comment explaining exactly why you want the coercing behaviour. I, at least, do this in all my reviews. And I find this disambiguates things nicely and helps me as a reviewer in understanding the expected data-flow of the code I'm reviewing.

Andrew

1: I could swear we have a style-guide for Gaia but I can't find it.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to