lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mar 19, 2013, at 6:56 PM, Kaj Eijlers <bizziboi@gmail.com> wrote:

> The fact that the bug can go silently and only reveal itself later goes for 99% of algorithmic bugs.
> 
> A function that can't handle a nil should check for it, not doing so is really programmer fault. No language can prevent programmer error. C just crashes, Lua silently accepts it, other languages try to handhold you more and start screaming and crying.
> 
> Lua is very powerful, and with power comes responsibility. You can't blame the language for not dealing with programmer error. 
> 
> If that's what you want, you're maybe using the wrong language. 

This seems like a philosophical answer that assumes the language would somehow lose power if it reported an error for for this type of bug. Obviously, languages prevent programmer mistakes all the time by reporting errors, including Lua. The fact that static analyzers have been created to detect this, and code written to work around it, suggests that it is a legitimate issue caused by the lack of error-reporting for undefined variable accesses.

Preston