bcquality/community/knowledge/performance
António Silva 47000475e3 Address correctness review: or/xor pattern, case value-set ordering
Fixes two points from JesperSchulz's review on PR #136.

1. boolean-operators-do-not-short-circuit.md gave one fix — nested if — for
   and, or, and xor alike. That's only correct for and: nesting if A then if
   B then Action drops the A-true/B-false case of A or B, silently changing
   the result. Gives or its own early-exit pattern (if A then exit(true);
   exit(B)), warns explicitly against applying the and-rewrite to or, and
   clarifies that xor is not a short-circuit candidate in any language since
   its result always depends on both operands. Adds an or fixture
   (IsEligibleForFreeShipping) to both samples so an agent has a concrete
   pattern to match instead of extrapolating from the and-only examples.

2. case-true-of-for-long-condition-chains.md derived stop-at-first-match for
   one comma-separated value set from the documentation's guarantee about
   the first matching value set — plural, i.e. ordering across value sets,
   which is not the same claim. The good sample's Item.Get / Blocked pair
   depended on the one the docs don't make. Restructures the sample to only
   comma-group the three pure, order-independent checks; Get and Blocked
   keep their own value sets, in order, relying solely on the guarantee that
   is actually documented. Description and Anti Pattern now state that
   boundary so it isn't re-collapsed later.

Also carries forward a parenthesis fix (not Item.Blocked in the collapsed
bad sample) that was made two commits ago but never landed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-02 11:24:09 +01:00
..
boolean-operators-do-not-short-circuit.bad.al Address correctness review: or/xor pattern, case value-set ordering 2026-09-02 11:24:09 +01:00
boolean-operators-do-not-short-circuit.good.al Address correctness review: or/xor pattern, case value-set ordering 2026-09-02 11:24:09 +01:00
boolean-operators-do-not-short-circuit.md Address correctness review: or/xor pattern, case value-set ordering 2026-09-02 11:24:09 +01:00
case-true-of-for-long-condition-chains.bad.al Address correctness review: or/xor pattern, case value-set ordering 2026-09-02 11:24:09 +01:00
case-true-of-for-long-condition-chains.good.al Address correctness review: or/xor pattern, case value-set ordering 2026-09-02 11:24:09 +01:00
case-true-of-for-long-condition-chains.md Address correctness review: or/xor pattern, case value-set ordering 2026-09-02 11:24:09 +01:00