Skip to content

docs(PC0030): explain the loops-only scope and the record cache trade-off - #239

Merged
Arthurvdv merged 2 commits into
mainfrom
docs/pc0030-loops-only
Nov 24, 2026
Merged

Arthurvdv merged 2 commits into
mainfrom
docs/pc0030-loops-only

Conversation

@Arthurvdv

@Arthurvdv Arthurvdv commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Companion to the Analyzers change that narrows PC0030 to reads that drive a Next() loop (ALCops/Analyzers#678).

What changed on the page

  • New title: Use partial records when looping over records.
  • Intro defines a loop read: any read that positions the record (FindSet, Find, FindFirst, FindLast, Get, GetBySystemId) followed by a loop that calls Next() on the same variable.
  • Breaking change callout: single-record reads are no longer reported.
  • New section Why single-record reads are not reported: the NST data cache mechanism, a three-row summary table of the BC 29.1 measurements (loop 5-8x faster for every entry method; full-key single read no gain and cached; other single reads no gain and lose the cache), the warning against SetLoadFields on frequently repeated non-key single reads, the BC 29.1 caveat, and a link to the investigation report on [Bug]: PC0030 - SetLoadFields should be used with caution Analyzers#531.
  • Examples switched to FindSet/Next loops; code fix section carried over with a loop example.
  • Exception list extended: Next outside a loop, a read inside its own loop body, a read without a Next loop.
  • Setup and reference tables section trimmed to the recognizer.
  • _index.md row and the PC0031 link text updated to the new title.

Built with hugo --minify: no errors or warnings.

🤖 Generated with Claude Code

…-off

PC0030 now reports a read only when a Next() loop on the same variable
follows it. The page explains why single-record reads are no longer
reported (no measurable gain; repeated non-key reads lose the NST data
cache), summarizes the BC 29.1 measurements, carries a breaking-change
callout, and switches the examples to loop reads.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
A running total invites a CalcSums discussion and distracts from the SetLoadFields point. The example now collects e-mail addresses for a salesperson's customers, which has no set-based alternative and shows that the SetRange field is not loaded.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@Arthurvdv
Arthurvdv merged commit 01a429a into main Nov 24, 2026
1 check passed
@Arthurvdv
Arthurvdv deleted the docs/pc0030-loops-only branch November 24, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant