Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak the grammar of DiffErrStrings outputs #140

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

drevell
Copy link
Contributor

@drevell drevell commented Jun 15, 2023

The previous output is slightly problematic because it contains grammatical ambigity that is only resolved after the first error message is printed. It's a Garden-path sentence.

When an error message is large, the user sees expected error <wall of text>...... The obvious mental parsing of this is incorrect: "[we] expected [the] error [to be] ". Once the user finds the remainder of the message after the wall of text, they find out that their mental parse tree should actually be "[we] expected [that the actual] error [we got which was] ...". The problem is exacerbated for large error messages where the sentence structure is not visible at a glance.

The previous output is slightly problematic because it contains
grammatical ambigity that is only resolved after the first error message is
printed. It's a [Garden-path sentence](https://en.wikipedia.org/wiki/Garden-path_sentence).

When an error message is large, the user sees `expected error wall_of_text.....`. The obvious mental
parsing of this is incorrect: "[we] expected [the] error [to be] wall_of_text". Once the user finds the remainder of the message after the wall of text, they find out that their mental parse tree should actually be
"[we] expected [that the] error [we got, which was] <wall of text>...". The problem is exacerbated for large error messages where the sentence structure is not visible at a glance.
@drevell drevell requested a review from a team as a code owner June 15, 2023 20:02
@drevell drevell requested review from a team, sethvargo, verbanicm and spencergoldberg June 15, 2023 20:02
@drevell drevell merged commit 683ea9d into main Jun 15, 2023
@drevell drevell deleted the drevell/differrstrings_grammar branch June 15, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants