On Sat, Feb 15, 2014 at 5:24 PM, Björnke von Gierke <b...@mac.com> wrote:

> Can someone elaborate why assert is better then using "is true/false", and
> what additional things it adds?
>

'assert' is designed for writing tests for your code. That being the case,
if 'assert' fails then the assertError message is sent which allows you to
log the error. If you are releasing an update to some code, you run your
tests and check your log to see if you broke anything.

If you are writing tests with complete coverage for a code library you may
end up with hundreds or thousands of 'assert' handlers that test that your
code behaves as it is supposed to. I think the 'assert' syntax is much more
compact and easier to write/read then a number of if/then statements that
then make a call to a logging function.

-- 
Trevor DeVore
Blue Mango Learning Systems
www.screensteps.com    -    www.clarify-it.com
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to