- Passing large structures by reference can be significantly faster than passing them by value, as the latter requires copying the whole structure. Likewise, returning a large structure by reference can be faster.
Ref: https://www.infoq.com/news/2016/04/CSharp-7?utm_source=infoq&utm_medium=popular_widget&utm_campaign=popular_content_list&utm_content=homepage
- Throw specific exceptions to make it easy for handling.
- Avoid return statement inside Finally block as it suppress the exception being thrown out from the method.
- Avoid returning Null.
When we return null, we are essentially creating work for ourselves and foisting problems upon our callers. All it takes is one missing null check to send an application spinning out of control.
0 comments:
Post a Comment