On Wed, Feb 5, 2020 at 3:01 PM Michael Glasgow <[email protected]> wrote:

> I've seen some mention that one should avoid using "quick" in
> complex rulesets, but I'm not sure why.  I suspect there is some
> rule of thumb that I'm missing?
>

I suspect this advice was actually intended to be that you should either
use "quick" all the time, or never.  In other words, use it consistently.

If you use it all the time, your ruleset is easy to understand as long as
you keep in mind that it uses "first match" semantics -- the first matching
rule wins, because all rules are "quick".

Or, if you never use it, your ruleset is still easy to understand as long as
you keep in mind that it uses "last match" semantics -- the last matching
rule wins, because no preceding rules were "quick".

Selectively using "quick", or selectively not using it, can lead to
confusion
where you thought first match or last match applied, but it actually did
not.

I always use quick and I think it makes my rulesets clearer, because I
personally find "first match" to be easier to reason about.

-ken

Reply via email to