I think a lot of code highlighting is basically ineffectual, though, given that it (almost always) highlights based on keyword-based regex, rather than the semantic meaning of the code.
I think a lot of code highlighting is basically ineffectual, though, given that it (almost always) highlights based on keyword-based regex, rather than the semantic meaning of the code.
I contest that they highlights based on keyword-based regex too. I haven’t formally analyzed TextMate grammars, but I believe the scoping behaviors take them into context free grammar territory.
I don't think I would care one bit if my syntax highlighter stopped making keywords blue and type names green. But damn, would it get frustrating not having dumb quoting mistakes stand out right away. I like fixing those based on immediate visual feedback as I type, vs looking at a surprise compiler error next time I try to build.
Which of the below string expressions (C# as example language, many are similar) has a mistake?
1.
"Most strings are " + easyOrHard + " to read and " + concatenate + " with variables
2. "Some, like \"" + onesWithQuotes + "\" are trickier"
3. "Your friend \" + friend.Username + "\" has joined the chat"
4. @"In C# multiline string literals denoted with @, \ is a legal character on its own and """" is used to escape the "" character"
5. @"You're probably a jerk like my buddy """ + name + "" if you mix syntaxes like this"> printf("this is a test\n"
> "this is \"another\" test\n"
> "hello world\n");
You're right though, I do have to pay more attention in strings. Paying more attention doesn't seem like a negative thing to me, though.
Could be correlation rather than causation. Presumably, you're a more experienced programmer now than you were three years ago and you might be making fewer errors and paying more attention regardless of whether you turned off syntax highlighting.