lua-users home
lua-l archive

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


* steve donovan:

> On Wed, May 19, 2010 at 1:06 PM, Nikolai Kondrashov <spbnick@gmail.com> wrote:
>> Thanks, I think that Metalua or maube LuaMacro as Steve suggest is my way :)
>> Completely forgot about the macros when I asked the question :)
>
> There's always C.A.R Hoare on the subject of disabling assertions:
>
> [[
> ... it is absurd to make elaborate security checks on
> debugging runs, when no trust is put in the results, and
> then remove them in production runs, when an erroneous
> result could be expensive or disastrous.
> ]]

Safety-critical software typically does not have asserts because they
are dead code and dead code won't pass certification.

If software is not safety-critical, what do you do with it?  If it's
GUI software, chances are that an assert popup ends up on Failblog and
similar sites.  In many cases, it's just better to hobble along.  For
server code, it tends to be worse even because if you take the assert
seriously, the server is gone after it fires, until operator
intervention.  Unfortunately, improper asserts are a common source of
crasher bugs.

I'm not saying that Hoare was wrong, but he seems to ignore the
possibility that asserts are not necessarily better than the code
around them.