Friday, August 31, 2007
Grammaticalization in text editors?
Syntax highlighting in text editors typically only works for well-defined programming language categories: keywords appear in one color, identifiers (variables) in another, comments in a third, etc. While using the vim editor to edit a Python program today, I added an "XXX" comment to indicate that I wasn't happy with the solution I'd devised for that part of the problem. XXX is a cultural convention, not a feature of the Python language, and in any case it was inside a comment. Still, the vim editor's syntax-highlighting feature flagged the XXX in a bright yellow background, making it more prominent than the rest of the program. Any modification to the XXX turned the highlighting off. In other words, someone working on the vim editor had decided to treat a cultural convention like a syntactic feature of the language. Programming-language textbooks often start by describing programming languages as a simplified version of human languages, but I never expected to see this kind of thing happening! It suggests that grammmaticalization is a strong driving force in our use of language.