[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Undefined variables returning nil
- From: William Sumner <prestonsumner@...>
- Date: Tue, 19 Mar 2013 22:34:05 -0600
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
- References:
- Undefined variables returning nil, William Sumner
- Re: Undefined variables returning nil, Petite Abeille
- Re: Undefined variables returning nil, William Sumner
- Re: Undefined variables returning nil, Kaj Eijlers
- Re: Undefined variables returning nil, William Sumner
- Re: Undefined variables returning nil, Petite Abeille
- Re: Undefined variables returning nil, William Sumner
- Re: Undefined variables returning nil, Geoff Leyland
- Re: Undefined variables returning nil, William Sumner
- Re: Undefined variables returning nil, William Ahern
- Re: Undefined variables returning nil, Josh Simmons
- Re: Undefined variables returning nil, Kaj Eijlers