4 ms·
To be fair Lua also made some bad decisions, though maybe not as bad as javascript: - tables being used for both objects and arrays can create a lot of confusi
by SkiFire13 1y ago
To be fair Lua also made some bad decisions, though maybe not as bad as javascript:
- tables being used for both objects and arrays can create a lot of confusion, especially when you have some integer keys, but not all, and especially when they are not consecutive or one of them is 0
- indexes start at 1
- assigning nil deinitializes variables/entries instead of assigning the value `nil` (this becomes especially bad if you mistakingly try to use nil as a value in an array/table)
- nil and false are falsy, but not 0, which instead is truthy
- growlNark 1y agoNo disagreement here; I also fundamentally question the cardinal indexing and conflation between table and array. But it's at least internally consistent and certainly makes more sense than mandatorily indexing arrays with floating point.
- ufo 1y agoTables being dual purpose is fine. The real problem is that assigning nil deletes the table field. Unfortunately, fixing that now would cause Python3 levels of breakage.