← Back to context

Comment by Animats

6 years ago

Syntax highlighting shows something that's already visible. What could be highlighted that isn't already visible?

Undefined variables? Those really should get a squiggly underline, as with spell checkers. Some IDE probably does that already.

Anything more subtle?

A key point in language design and program tooling is detecting that thing A, which needs to be consistent with thing B far away in some other module, isn't. Most hard to find defects involve some distant relationship. What could be done with color or other automatic annotation to help?

Undefined variables is already a thing in most IDEs? I know VSCode does it. I can't imagine the others don't.

One interesting thing I've found in JavaScript (and I'm guessing it would be useful in Python) is the CodeSpell plugin for VSCode

https://marketplace.visualstudio.com/items?itemName=streetsi...

It spell checks code by separating camelCaseWords and identifiers_with_underscores. Sure it's not "smart" but for dynamic languages, at least for me, it helps prevent bugs. A static language the IDE would already have the info it needs to highlight a non-existent property but in a dynamic language generally not so I've found it quite useful.