On Mon, Apr 25, 2022 at 4:19 PM Javier Sanchez
Uninitialized variables always bear garbage.
On Tue, Apr 26, 2022 at 8:39 AM Niels Liisberg <nli@xxxxxxxxxxxxxxxxx> wrote:
Variables are always NULL when not initialised. So you see the 0 in the
debugger but it is actually NULL and your "IF" is unpredictable;
Does anyone know if the debugger *always* shows 0 for
uninitialized/null numeric values? (And I guess empty string for
character values.) Or does it just dump what's in memory, interpreted
as the declared type?
I suspect the latter, given that it probably simplifies the debugger logic.
I guess it is also *helpful* to get a straight memory dump, given that
such information could be what the programmer is looking for while
Does the debugger show (or is there a setting which tells it to show)
the null indicator for each variable?
If not, that would be a great enhancement.
 I suppose some would say that a programmer should *always* be
interested in the contents of memory. I would argue that, in 2022,
most of the computing world has long since come around to the idea
that only people who write operating systems, programming languages,
device drivers, and the like should have to care about that. Most
programmers would be far more productive working at a higher level of
abstraction. Indeed, SQL was designed with that in mind, and that's
what Rob was trying to debug. If the debugger had clearly indicated
that the value was NULL, he would have found and fixed the problem in
less time than it took for him to write the email describing the
situation to us.
As an Amazon Associate we earn from qualifying purchases.