With apologies to
Edsger Dijkstra, I bring you a much smaller treatise on the benefits of using Range Checking. As many of you are aware from previous entries on the topic, I have been dealing with issues relating to the PopupMode off and on for a while now. I went back to the drawing board on the problem I talked about where
using API subclassing to intercept paint messages for all components on a screen was broken due to PopupMode. I rewrote my component to use VCL subclassing (i.e. assign a procedure to the WindowsProc property), and things are much better (after much trial and tribulation). Part of the trials and tribulations I was having were due to accessing a dynamic array beyond the bounds of the array. It was resulting in 'Invalid Pointer Operation" error messages when shutting down the application. Debugging didn't reveal much interesting, and not much to chase further either. However, I realized I didn't have Range Checking or Overflow Checking turned on in my project. Turning these options on and running again showed me immediately where the code was broken, and allowed me to fix the problem quickly. Without this check, I was overwriting some memory and this resulted in the Invalid Pointer error later on.
So, long story, short: Range Checking can help you quite a bit during development. I don't necessarily advocate leaving it on for production code, though.