More examples of bad error messages with leaky abstractions: - Binding invalid left-hand side in rest property - Invalid BigIntLiteral - getter must not have any formal parameters - Unexpected token ILLEGAL
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I do not think having different error modes for beginners and “experts” is helpful. You can design error messages to be useful for both. There’s also a level of hubris assuming that “advanced terminology” is somehow more useful in decoding errors, it’s not.
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Wouldn't an error with "tokens" normally be a lexer error, not a parser error? :P I absolutely agree with you, though! So many parsers have horrible error messages.
-
JavaScript grammar is context dependent so the lexer is parser driven. Also “unexpected token” is fundamentally a parser error because the lexer already constructed the token.
- 1 more reply
New conversation -
-
-
Would you suggest something more like "Syntax error near <code>" followed by a code frame?
-
When there’s a syntax error it’s always being produced from a specific callsite. That callsite knows exactly why it was expecting a specific token. Rather than “Unexpected token, expected ;”, I think it should say “Unexpected CHAR, expected ; as the end of a statement” etc
- 1 more reply
New conversation -
-
-
I guess the story goes something like this: Step 1: until we come up with better messages, display errors that at least tell the truth about what happened Step 2: Come up with better error messages And then it's never time for Step 2.
- 2 more replies
New conversation -
-
-
*Especially* when finding unexpected tokens in real life is actually awesome.pic.twitter.com/VJjL0pObFS
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
While I agree that meaningful compiler messages (and error messages in general) are great, I do think a programmer should at least have some basic understanding of parsing - or at least understand the results when googling for it!
-
Why? Dont I really just need to know that I missed out a comma in my JSON? I don’t really need to know how they came across the error, just what I’m meant to do to fix it
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 