3 ms·
It's not that nil itself is a problem, the real issue is that every invalid table key access doesn't trigger an exception (like Python), but instead returns nil
by cyber_kinetist 5y ago
It's not that nil itself is a problem, the real issue is that every invalid table key access doesn't trigger an exception (like Python), but instead returns nil. And everything in Lua is built with tables (including whole class systems), so this makes debugging a serious pain in the ass.
In fact, even global variable accesses are designed to work as table accesses to _G (the global table), so if you make a typo then the interpreter doesn't say that you've mispelled a variable but instead silently gives you nil. This leads to all sorts of weird bugs that are very hard to track down. Probably the number one reason why I ditched the language for something else.