Tom Blocker wrote:
> And for the record, I stated not once but TWICE that an assert should be used 
> in an else stmt to help the maintainers of the code. If I thought that such 
> an error might escape development and function\regression testing then I 
> would include exception handling or other error handling. But my goal in this 
> case is to write code that if it becomes broken, that same code can help the 
> person who broke it to quickly locate his or her error. And I do so without 
> setting up unnecessary exception handling which is, I expect, much more 
> expensive than several IS tests. 
>   


Quick note, irrelevant to most other parts of the thread:

The statement "And I do so without setting up unnecessary exception 
handling which is, I expect, much more expensive than several IS tests" 
makes it look like exception handling is something expensive and it 
should be avoided. It's not, and it should be used as often as possible. 
When reading code, seeing the "try" keyword always shows the programmer 
thought about resource allocation and the possibility of failure. That's 
good...

Besides, using the "as" keyword doesn't set up any exception handling at 
all. It might raise an exception, but that's a different matter!
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to