RELEASE LiveCode 6.6 DP1

Mark Wieder mwieder at ahsoftware.net
Sun Feb 16 12:40:08 EST 2014


Pete-

Sunday, February 16, 2014, 9:11:23 AM, you wrote:

> All valid points. I'm just not seeing any big advantages over using if/then
> constructs, but I can see that being a personal preference.

Well, one advantage of assert is that the parameters pinpoint exactly
where the error occurred, making your debugging and logging tasks
easier. You don't need a switch statement to see what type of problem
and where it happened, the engine hands that to you, and you can log
it, display it in an answer dialog, whatever you want.

You can ship code with assert commands in place, as they should be
harmless and only come into play if something fails. Then when you
change code your tests will tell you if something's going to break.
You also have an extra bug reporting mechanism on the client end of
things: if something happens to break your code even though it passed
your dev tests, you can pop up the same log information and the your
users can relay that back to you.

Granted you could do all this without an assert command in the engine,
and we've done that for years, but this makes things easier, cleaner,
and helps the engine team ensure that they can catch bugs before they
release builds to us. I use asserts all the time in my real-world
coding, and I welcome their introduction to the LC world.

That said, I think the assert command is still in its infancy, as it
won't catch things like

assert 1 / 0

-- 
-Mark Wieder
 ahsoftware at gmail.com

This communication may be unlawfully collected and stored by the National 
Security Agency (NSA) in secret. The parties to this email do not 
consent to the retrieving or storing of this communication and any 
related metadata, as well as printing, copying, re-transmitting, 
disseminating, or otherwise using it. If you believe you have received 
this communication in error, please delete it immediately.





More information about the use-livecode mailing list