I just downloaded ReSharper, because many of my coworkers have been fawning over it for ages. I was looking through one of my programs, and I found a bunch of suggestions made by the extension, some helpful, some not. One suggestion, however, really confused me. Originally, I had this simple code:
foreach (Device foo in MasterDataGrid.ItemsSource)
{
Console.WriteLine("Value for {0}: {1}", foo.Name, foo.OriginalValue);
}
This works perfectly fine, and I have been formatting strings like this for ages now with no issue. However, ReSharper suggested that I use a resource instead of a string literal. Here is the code once ReSharper was done with it.
foreach (Device foo in MasterDataGrid.ItemsSource)
{
Console.WriteLine(Properties.Resources.MainWindow_HistoryButton_Click_Value_for__0____1_, foo.Name, foo.OriginalValue);
}
I am a novice to C# and programming in general, so I had no idea that this was a thing one could do.
Is this in any way better than what I had? In what situations would I notice a difference between the two pieces of code, and how big of a difference does it make?