Re: Code Comprehension



Chris Uppal wrote:
Pascal Bourguignon wrote:

When you have characters, use '\0' which explictely says Hello!
I'm a character.

Not really following on from that, but this is a convenient
point to raise an issue which interests me, and which we seem to
be skirting around without ever quite touching explicitly.

Very nice post!

Another downside of the "idealised" approach is that it risks
forbidding (some) idiomatic use of the language. As in the
running example, it would not allow:
if (!a || !b)
return;
but would insist on a more verbose re-writing.

Depends on how one idealizes. Instead of pretending that ! works only
with truth values one might construe it as the predicate 'holds-
nothing' on a category 'Value-or-nothing' (idealization of pointer
types) and write that code thinking, "if either of a, b holds no
string then return". But while this is arguably closer to the real
semantics the problems you raised with imagined semantics probably
still apply.


Martin

--
Quidquid latine scriptum sit, altum viditur.
.