[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Does anyone have "assert" blindness ?
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 8 Mar 2011 18:55:08 +0200
On Tue, Mar 8, 2011 at 6:43 PM, Jerome Vuarand <email@example.com> wrote:
> Maybe the point of assert is to be visible, to remind you that you
> need to do proper error handling there.
One strategy is to call important functions using pcall(), and then at
least you are not dumping a stack-trace on the poor user - unless you
_want_ to, of course!
There is definitely such a thing as too many assert() calls...
(I always liked the Perl-ism 'do_something() or die()' but expressions
cannot be statements in Lua)