Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Long ago, I worked on the operating system for a desk phone. With only 64K of RAM, there was no dynamic memory management whatsoever. We made heavy use of static variables and let the compiler figure out how to allocate everything at compile time.

It’s easy to forget that many applications probably don’t need dynamic memory management at all. You can often get away with allocating a few fixed size buffers and just handling the edge cases nicely when those buffers are full.

And in such a context, C is indeed a whole lot safer. No memory leaks. Your only concern is buffer overflows, which can be managed through careful use of sizeof when all of your variables are statically allocated. I’m not saying Rust and Go aren’t great options these days, but humble old C still works and doesn’t have to be nightmarishly complex.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: