With new return ref
I feel like I'm going back to
my youth and good old C++.
C# is lifting some of its limitations but still it is a safe language. Returning reference is not that important to all users,
but if you are pushing performance to the maximum you will appreciate it for sure. Also, out
declaration shortcut
is a very useful change.
Having nested functions totally make sense in some cases. In the past lambda expressions helped to overcome C# not having nested functions. Now with local functions we have better and cleaner solution.
Both Lambda Expression and Local Function will be converted by compiler to a "normal" function.
Do you like functions like TryParse
? Saying that it is ugly is an understatement.
Function is returning two values bool success
and int number
but we are getting one as a regular
returned value and second one as out
parameter. This is
not only inconsistent approach, it will also not work for async
functions.
With new C#7 feature and library defining generic structure System.ValueTuple
we got much more elegant solution for returning multiple values.
There is more to it. Using LINQ just got easier as well!
Previous YABE (Yet Another Blog Engine) I made in 2014 just to learn NodeJS, AngularJS, MongoDB and PaaS (platform as a service in the cloud). Did I like my choice? First Yes and then No.
To bind or not to bind: that is the question…
If you are using Silverlight (my deepest condolences) you have no choice of using BindingList. WPF has it, but you should be aware that BindingList is maybe doing more than you expect and want.