Linting standards: Bitwise operators

Antranig Basman antranig.basman at colorado.edu
Sun Apr 6 11:20:14 EDT 2014


Checking with the community about a jshint option that came up in the 
channel on Friday - do we agree that the prohibition against the bitwise 
operators (which I believe was simply inherited into jshint from the 
Crockford days) is irrational?

Their annotation simply reads
http://jshint.com/docs/options/#bitwise

"This option prohibits the use of bitwise operators such as ^ (XOR), | 
(OR) and others. Bitwise operators are very rare in JavaScript programs 
and quite often & is simply a mistyped &&."

IMO just because they are "rare" doesn't mean that they are not to be 
recommended - also the XOR operator seems indispensable without which we 
would write monstrosities such as if (!!a !== !!b).

Are we ok to just turn off this option in our linting?

Cheers,
a


More information about the fluid-work mailing list