3 ms·
The problem with C, for most application domains, is not that it requires pointer knowledge, but that it requires constant attention to this knowledge. Combine
by sixbrx 14y ago
The problem with C, for most application domains, is not that it requires pointer knowledge, but that it requires constant attention to this knowledge.
Combined with the fact that there's no warning when you've stepped outside the bounds of an array, I think makes it an extremely dangerous language to use for large scale programming.
Years back, a friend was maintaining a system collecting and processing scientific data, in C. Several papers have been published on this data over the course of many years. I remember the sinking feeling we both got - mixed with real fear - when he told me he had discovered an error where an array's bounds had been miscalculated. I don't even want to think about the possible ramifications of that...
For some application domains low level control is necessary of course, or for others the performance gain may make the tradeoff worth the cost.
- bad_user 14y agoThe problem of people building on top of C is that C is not a language meant for applications. A system collecting and processing scientific data is too high-level for a language like C. In fact no application should be written on top of a language that doesn't do garbage-collection by default, unless you've got the resources of big companies. Any language that doesn't do garbage-collection by default is dangerous for large scale programming. On array bounds checking, you can't do such bounds checking at compile time, so you have to rely on runtime checks and metadata. As my highschool professor kept telling us, C is a medium-level programming language. It's optimized for moving bits around in memory, while the code remains reasonably platform-independent. Adding array-bounds checking by default doesn't make sense for a language like C, because it stays in the way of moving bits in memory.
- pjmlp 14y ago> Adding array-bounds checking by default doesn't make sense for a language like C, because it stays in the way of moving bits in memory. Any proper language for systems programming allows to turn off bounds checking if required- This is the way it should be done, disabling the bounds checks on the few spots that require them being disabled, after profiling if they being on really affects the performance of the application.
- sixbrx 14y agoI think we're in violent agreement. It's not the language it's the usage outside of where it's appropriate.