Hacker News new | ask | show | jobs
by altrego99 2891 days ago
Agree that this is a problem (if the programmer is not careful).

But serious question, why even bother with this one fix?

The only reason for the fix is so to make it more difficult to make errors.

Fix arrays, then you would fix null pointer, then you might add objects, templating/generics to support a good collections library, rtti, and before you know it you are creating another one of c++, D, go, java. And we already have those.

C paved the way. Why not let it be the end of it?

2 comments

Because buffer overflows are probably the number 1 security bug in C programs.
I was wondering why you were championing this idea and agreeing with the posted link in almost every way. Then I went back to the link and figured it out :)

P.S. thank you for everything you have done with D. I read in another HN thread about Better C, and it convinced me that D is the language I should be investing my time in learning and using.

> I read in another HN thread about Better C

A good tool to check out, but which hasn't been promoted much because it's new, is dpp[1]. You can directly reference C header files in your D code. With that, betterC mode becomes a viable option for adding to an existing C project.

[1] https://github.com/atilaneves/dpp

Paved the way for what? Mainstream security exploits?

There were OSes being written in better languages outside Bell Labs, had it been allowed to sell UNIX instead of giving it away for a symbolic price to universities, and the historical outcome would have been completely different.