Sujet : Re: question about nullptr
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 10. Jul 2024, 15:36:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86r0c18gbl.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Keith Thompson <Keith.S.Thompson+
u@gmail.com> writes:
Hmm. I like the idea of a type-agnostic way to express a "zero"
value, [but] C's use of 0 for all scalar types strikes me more as
an historical accident than a design feature.
I don't think it was an accident at all. It was chosen to be
consistent with how if(), while(), !, ?:, and so forth, all act.
There is a very consistent design philosophy there. Sometimes
people who come from a strong Pascal background don't like it,
but personally I find the C model easier and more convenient to
work with than the Pascal model.