4 ms·
As a professional programmer, I've come to prefer code written to be understood by someone who started two weeks ago.
by WalterSear 9y ago
As a professional programmer, I've come to prefer code written to be understood by someone who started two weeks ago.
- debaserab2 9y agoThen by that principle you'd want to use !! since casting via function or constructor differs more between languages.
- WalterSear 9y agoWhat it looks like in other languages is only minorly relevant to its obviousness and readability.
- debaserab2 9y agoI don't see the argument that Boolean(val) "reads easier" than !! as long as you know what !! does.
- joesb 9y agoIn that case, don't write any code. Don't use function. Don't use React. Don't use lodash. Don't use third party library. People who only start coding for two weeks can't understand any code. People who start has enough experience to work, but only start in this project for two weeks, will understand "!!" idiom.