When is “Try” supposed to be used in C# method names?

We were discussing with our coworkers on what it means if the method name starts with “Try”.

There were the following opinions:

  • Use “Try” when the method can return a null value.
  • Use “Try” when the method will not throw an exception.

What is the official definition? What does “Try” say in the method name? Is there some official guideline about this?

6 Answers
6

Leave a Comment