The problem Visitor solves
A document model with five node types: Heading, Paragraph, Table, Image, CodeBlock. Sensible classes, stable for two years — nobody adds node types any more.
What does keep arriving is operations. Render to HTML. Export to plain text. Count words. Estimate reading time. Extract every image URL for the CDN pre-warm. Validate accessibility. Produce a table of contents. Each one is a new method on all five classes.
So Paragraph now knows about HTML escaping, plain-text wrapping, word counting, reading speed, CDN URLs, WCAG rules and heading levels. It changes every time an unrelated feature ships, its imports span half the codebase, and a bug in the accessibility checker means editing the same file as the HTML renderer. Five classes, seven reasons each to change — and the seven operations are scattered across five files instead of living in one each.
