4 ms·
Nooo! Again? > if we really cared about security we wouldn't be writing in C. If we really cared about security we would definitely be writing in C. If we re
by notorandit 4y ago
Nooo! Again?
> if we really cared about security we wouldn't be writing in C.
If we really cared about security we would definitely be writing in C.
If we really cared about security but would prefer not to think about it we wouldn'd be really caring about security, no matter the language.
Caring is done by little details. You don't want to risk with dangling pointers, do you?
Then you either rely on someone else's work (garbage collector?) embedded in some "secure" language or you do your homework with careful memory allocation.
What about buffer/stack overflows?
Same.
Finally, have you asked yourself with which language your "secure" stack (kernel, userland, compiler/ interpreter etc.) has been written?
I bet a huge part is in C.
- butlerm 4y agoIf it were remotely feasible to create a competitive operating system kernel in a memory safe language with a tracing garbage collector, a kernel written in something like Java or C# would have taken over the world by now.
- kelnos 4y agoSure, but I expect that many many many more people have read and run and tested and hardened my kernel, userland, compiler/interpreter than have done so for the code I am just now writing. I have a lot more faith in the correctness of all that other code than I do in the code that I'm about to write, at least not until the code I'm about to write has seen similar scrutiny and usage -- which it likely never will. Put another way, I trust the Rust code I write to be free of memory errors much more than I trust the C code that I write (despite having much more experience writing C than Rust). And yes, that's even accounting for the possibility of bugs in the Rust compiler that cause my program to do unsafe things with memory. Assuming I could actually maintain the focus and discipline to be my absolute most careful self every moment while writing C (which I, in reality, cannot), I still think the Rust compiler is safer than I am. Frankly, I would consider nearly anyone (and possibly just an unqualified "anyone") who believes otherwise about their own abilities to be naive at best, and actively arrogant at worst.
- avgcorrection 4y agoI play rugby without a mouthguard because it keeps me disciplined and I care about my own safety. /s