Your answer already expresses the purpose. You must see this might be useful for logging or throwing exceptions. for example. public void DoStuff(object input) { if (input == null) { throw new ArgumentNullException(nameof(input)); } } this is good, if I change the name of the variable the code will break instead or returning an exception with an incorrect message. Of course, the uses are not limited to this simple situation.
Massimo Prota
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Massimo
Contact Massimo, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack