lua-users home
lua-l archive

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


Hi Steve,

you answered Roberto's question:
> > Are
> > you sure the bug is not a "regular" bug in your
> > program? 
>
> I'm pretty certain of that.

And then a bit later you say:
> I would really like to do that, but this is a fairly
> large system consisting of tens of thousands of lines
> of code. Since the bug is so hard to reproduce even
> with the whole system, it may take me a very long time
> to get it to show up in a small sample.

How do you get to be so certain that your code is correct?

Since Lua is a pretty extraordinarily stable platform (and very small,
to boot), my first inclination is to doubt my own code when something
breaks.  So far, this has been the case in 100% of all my problems.

I would suggest you try investigating your problem in a bit more
depth.  I like to debug using print statements.  Since you say that
you are getting errors in different parts of your code, try adding
some suitable prints into those places, to allow you to reaffirm your
expected values.  Then with the results of those you may be able to
backtrack in the code, adding more prints as you go along.

Unfortunately, debugging is still a bit of a black art.  Kernighan and
Pike cover a little bit in their Practice of Programming book, which
is a very good read.

Robby