Re:Programming Languages Are Simply Not Powerful Enough
by pjmlp on Friday March 01, 2013 @11:06AM
(#5304988)
> 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.
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.