3 ms·
Do you miss highlighting for string literals? I don't think I would care one bit if my syntax highlighter stopped making keywords blue and type names green. Bu
by rspeele 8y ago
Do you miss highlighting for string literals?
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"
- fao_ 8y agoI like using C's string gluing thing: > 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.