Fixing C's Biggest Mistake

areYouSureAboutThat areYouSureAboutThat at gmail.com
Thu Dec 22 10:44:07 UTC 2022


On Wednesday, 21 December 2022 at 19:31:22 UTC, Walter Bright 
wrote:
>
> I posted this on Hacker News in response to an article about 
> Microsoft's Checked C.
> =======================
> Checked C:
>
>     int a[5] = { 0, 1, 2, 3, 4};
>     _Array_ptr<int> p : count(5) = a;  // p points to 5 
> elements.
>
> My proposal for C:
>
>     int a[5] = { 0, 1, 2, 3, 4};
>     int p[..] = a;  // p points to 5 elements.
>
> https://www.digitalmars.com/articles/C-biggest-mistake.html
>
> https://github.com/Microsoft/checkedc/wiki/New-pointer-and-a...

I don't like Microsoft's Checked C.

I don't like your alternative. Not because it's not better than 
Microsofts, which yours certainly is, but because I don't believe 
C needs fixing.

I also don't want to have to learn new things, to program in C.
I'm sick of having to learn new things all the time!!
That's precisely why I like C. Cause I don't need to.
Sure C is unsafe, but that's the way I like it.

Having said that, I'd much rather see your alternative in the C 
standard, than Microsofts.

But I rather see neither.

The ship has sailed on C. Anyone that uses it knows it quirks and 
just deals with it.

Thankfully, it's extremely unlikely either would ever get into 
the standard in any case.

As for importC, I don't see a problem, since D should be able to 
provide extensions to it's C implementation, just as other 
implementators are free to do so.



More information about the Digitalmars-d mailing list