Don’t use Resource Strings with C#

I recommend separate static class files with static read-only strings.

Problems:

It’s better when strings are in code-files, with multi-line strings using @”” or $@””. Maybe append “Resources” at the end of the class name, as a convention.

Benefits:

  • You can use any coding techniques with them
  • You can be more cohesive, create multiple separate classes
  • You can have static functions to take and apply parameters
  • You use the normal text editor
  • You can press F12 on a reference, and get directly to editing the string
  • No XML to deal with – less merge conflicts

 

One thought on “Don’t use Resource Strings with C#”

Leave a Reply

Your email address will not be published. Required fields are marked *