Quote:
Originally Posted by Quoth
No, it's not ever appropriate ever in ordinary applications. The high level language and compiler does it.
|
Depends on what you mean by "ordinary". If you're talking about basic end-user apps, with no high-performance requirements, then maybe. Some fields will have different definitions of "ordinary", though.
Bear in mind that in C and C++, array indexing *is* memory arithmetic ("a[b]" === *(a+b)").
Quote:
See also the stupidity of how strings / array bounds* work in most languages and 40 years after this being identified not just as a way programs crash, but a common security exploit there is still stupid programming.
|
Bounds-checking all array accesses is a serious performance hit in many circumstances.
There will always be stupid programming. One of my particular beefs is how much of current language development is aimed at making it safer for poor programmers, rather than helping expert programmers produce high performance code.
Quote:
If you need to do direct address arithmetic outside of a specialist (likely assembler) device driver, for performance, you have a rubbish compiler.
|
No arrays in C or C++ then?