3 ms·
This obsessive horror with Lua's base-1 array numbering somehow overlooks the far more upsetting fact that `0` and `''` are both truthy in Lua. To be clear: I
by 1attice 3y ago
This obsessive horror with Lua's base-1 array numbering somehow overlooks the far more upsetting fact that `0` and `''` are both truthy in Lua.
To be clear: I love Lua; but if you're going to have a reaction, please react to the features that are genuinely counterintuitive, rather than (if you will) counter-counterintuitive.
- FreshStart 3y agoNil and false are both not truth. It's also just a leaving c conventions, which state anything not 0 is true (& 0XFFFF!= 0) be praised has been expanded to ridulous levels. The merge of existence checks and boolean operations in the same operator is wrong.
- 1attice 3y agoYes, I knew this, and it's beside the point. Which is that, despite loving Lua, I can recognize that it features several 'improvements' which are going to cause Surprise for a lot of coders. Which is bad, following the Law of Least Surprise. Personally, I agree with you, but I can also see why Lua initially turns a lot of people off; it took a good year of meeting it in my Neovim config before I accepted that it wasn't some horrible corruption of JavaScript. Now I tend to think of Lua as an improvement over JavaScript: spare, elegant, and almost perfect. But I remember that first year, and I can still empathize with people in their first year of Lua.