> And to add to that, assuming that a literal backslash
> represents a file separator is DEFINITELY bad
> design.
>
> Drake
It was just an example...
Escaping is as useful when using XPaths, Regular expressions, etc...
Don't pick to the small details :) (And picking to the path seperator (I'm wide aware of the static members of class File) is really nto relevant)
I agree that most strings should be externalized (it's not a matter of design, just of good programming), but still, some strings will always stay hardcoded.
(js escaping your '<' in xmls is better?) - mostly when experimenting and writing some 'scratchbook' code.
The facility for escaping strings in C# and in Python is very useful. Moreover, adding this string escaping mechanism will be backward compatible.
Any other opinions?
Thanks :)
> Hi there,
> I've been programming in Java for 5 years now, and
> there is one feature which will make my life alot
> easier.
> I'm talking about string escaping (a la c#'s
> @"c:\Docs\Source\a.txt", or python's single quoted
> strings).
>
> What do you think about it?
It could be handy, but personally I don't think it's a problem that needs fixing or even a situation that needs improving.
My personal opinion is there is not sufficient gain in it worth to introduce a new syntax element. But it's of course up to the language designers to make that judgement.