Fixing C's Biggest Mistake
areYouSureAboutThat
areYouSureAboutThat at gmail.com
Tue Dec 27 21:39:36 UTC 2022
On Tuesday, 27 December 2022 at 00:38:33 UTC, Walter Bright wrote:
> C uninitialized variables was another fountain of endless and
> hard to track down problems. D initializes them by default for
> a very good reason.
Yes, D can certainly claim to have better strategies than C to
'reduce the number of weaknesses that occur in software'. This is
a good thing, surely.
https://cwe.mitre.org/data/definitions/1337.html
But in the end, C (as you know of course) operates at a low level
of abstraction, and does so on purpose, and therefore such
mitigation strategies are not consistent with the spirit and
design goals of C.
Nobody (as far as i know) works on trying to create a better
assembly. It is what it is.
Why does everyone want to create a better C? Well, they don't
really. What they really want to do, is reduce programming errors
by constantly raising the level of abstraction.
I like initialised variables in D. I wouldn't like them in C. It
would feel like I've lost control. And in C, it should always be
me who is in control (otherwise I'd have to revert to assembly).
More information about the Digitalmars-d
mailing list