Re: Essential feature: assertions
- Posted by George Henry <ghenryca at LYCOS.COM> Jan 30, 2001
- 518 views
On Mon, 29 Jan 2001 23:46:24 David Cuny wrote: >George Henry wrote: > >> <assorted flamebait about b&d features> Flamebait, probably. B&D features? Whazzat? >There are obviously potential problems with asserts - for example, the test >may have unexepected side effects. Yes, it's a good idea not to do tests that may have side-effects, such as calling a function, etc. But how can a simple test, such as "myVariable = value" have an unexpected side effect? In general, yes adding code for whatever reason - even to ensure the correctness of existing code or diagnose a problem - opens up the possiblity for further errors. But hopefully in the process one takes at least two steps forward for every backward step introduced, so that the ultimate result is more correct code. > Sometimes just changing the length of the >code or number of statments can have odd side effects. I have seen that happen in C. But the "odd side effects" were always the result of some *other* error. For example, a logic error that wasn't causing an actual error suddenly did because some code was added. Adding correct code to correct code does not cause odd side effects. > I still recall >struggling with Euphoria, trying to figure out why the interpreted version >of the code behaved differently than the bound version. Specifically, for instance? Just curious. Thanks for your input and support for the basic idea, David. George Get your small business started at Lycos Small Business at http://www.lycos.com/business/mail.html ____________________________________________________________ T O P I C A -- Learn More. Surf Less. Newsletters, Tips and Discussions on Topics You Choose. http://www.topica.com/partner/tag01