3 ms·
C makes these sort of problems more common and occupy more time/energy/source code than they need to. The language doesn't try to help the programmer with even
by dbaupp 11y ago
C makes these sort of problems more common and occupy more time/energy/source code than they need to. The language doesn't try to help the programmer with even the most basic of these sort of resource management problems. Most modern languages offer tools to handle some subset of them (e.g. GC for memory in managed languages, or destructors for memory and more in C++/Rust), reducing the burden on the programmer for normal resource life cycles and hopefully making it easier to handle the abnormal cases better.
Sure, it's not generally possible for a language to perfectly manage every resource all the time, but this doesn't mean we should just give up and throw away computer assistance in cases when we can have it.
C is an important language, but there's no need to look at it through rose-coloured glasses.