4 ms·
> Every use of operators can be considered a syntax trick That's blatantly false for strict languages, like JavaScript. For a function, all arguments are evalu
by maweki 3y ago
> Every use of operators can be considered a syntax trick
That's blatantly false for strict languages, like JavaScript. For a function, all arguments are evaluated before the function is evaluated. For operators this is not true. On the and-case, the second argument is only evaluated if the first one evaluates to something true-ish.
You can only use this supposed and()-function, if you pass closures instead of values and not every language has those.
- iforgotpassword 3y agoThen we should consider these reserved keywords and run a transpiler on our code that converts those to the unholy && and || syntax that makes the code really hard to read. You shouldn't expect every junior programmer to invest the necessary time to learn the meaning of all this archaic symbol salad. While at it we should also remove curly braces and go with Basic's if/end if, function/end function and so on.
- cristeigabriel 3y ago`&&` and `||` are very well defined (for the better part, there's languages where `||` does more than just Logical OR.), this double-not hack is just a hack, and can be achieved in many more ways. Stop trying to be obfuscatingly clever, the right time and place for that is outside of professional environments. You don't go around applying tricks from Hacker's Delight without explaining them, do you?