> The syntax itself is just begging you to make a subtle mistake.
C's syntax is fine (if a bit ugly around declarations), it's really the memory safety that gets you.
Re:Ask HN: How do I learn C properly?
by bronipstid on Sunday March 08, 2020 @04:26PM
(#22520377)
It depends on what you're doing. Low level stuff pretty much has to be C. But for applications I agree there are much better alternatives these days.
Re:Ask HN: How do I learn C properly?
by PureParadigm on Sunday March 08, 2020 @04:42PM
(#22520469)
Yeah, there may be some situations where C is necessary as a wrapper for assembly if you're _extremely_ memory constrained or something like that. But I wouldn't have any confidence in it working as intended unless it's dead simple.
But, for your own sanity and everyone else's, do not start new projects in C! (Aside from purely academic ones for you to learn.) The point of a programming language is to help humans write safe and correct code. In this sense, C has completely failed. The syntax itself is just begging you to make a subtle mistake. And due to lack of memory safety, even the most well tested and scrutinized projects in C/C++ (such as Chromium) suffer from buffer overflows or memory leaks, potential security vulnerabilities that are automatically prevented by design in other languages. If you need to do something low level with any sort of confidence, use a memory-safe language like Rust, which can even do interop with existing C libraries and code.
(Edit: typo)