Below are some common responses to the question:
- It is more efficient
- It creates an object
- It is more readable
- It turns into better IL code
- It is easier to type
- It is easier to understand for newbies
- It can be used in a switch statement
- It ...
My conclusion to my extensive research is that it doesn't matter. Performance is not an issue when using either in a real life application. When you are looking at code and come across this, don't change "" to string.empty or vice versa. You are wasting your time and adding history to a file that does not need to be there. You are not following the Boy Scout Rule because the file is not in a better place than you left it, it is in the same place.
I am open to hearing thoughts on this to feed my OCD, but from everything that I have read I don't think there is anything new that would support one being so much better over the other. It has been and still is in my category of personal preference.
peace yo!
All I have to say is:
ReplyDeleteString.Empty
I mean....
""
wait...
string.Empty