|
|
On 8/1/2011 9:30, Warp wrote:
> Nobody claimed it is. It's just something you have to live with if you
> program in C (or its close variants).
Yes, I understand that.
> But you *can't* expect something specific to happen if you dereference
> null (even if you do it "separately").
I know that too. I really do completely understand the problem. It's exactly
why I'd say that maybe C or its close variants aren't good for a new user.
I'm merely pointing out that "it isn't surprising if you already know it's
going to happen" combined with "you should know it's going to happen because
you need to understand the detailed rules of every single operation possible
to write a program that silently doesn't do something good" combines to make
"I only know a little bit" a bad choice.
> If you dereference null, *anything*
> can happen (including the following code doing something completely different
> than what you expect).
And it's not just dereferencing null. It's any of the undefined behaviors
which can lead to the compiler doing very unintuitive things if you're not
aware of the rule.
--
Darren New, San Diego CA, USA (PST)
How come I never get only one kudo?
Post a reply to this message
|
|