|
Google has begun pushing out the Android Marshmallow update. This new version of the mobile operating system includes new features and bug fixes across the platform. Although the rollout began today, end users will have to wait for their phone manufacturers to port the OS to their platforms in order to use it. S'mores anyone?
|
|
|
|
|
In this interview, Coveros CEO and agile instructor Jeff Payne discusses why you should make the move to agile, its many benefits, and how to transition. He also explains his SQE Training course, Fundamentals of Agile Certification. Transitioning to agile need not be payneful.
|
|
|
|
|
Ah, yet another article setting up strawmen and then knocking them down.
|
|
|
|
|
With the final version of C# 6 having been released, we can seen that a lot of syntax changes have occurred since its inception. Because of this, I’ve noticed that most of the blog posts currently on the internet don’t work anymore or are too vague about how they implemented a feature.
I thought it would be useful to make a list of the most essential C# 6 features with simple code examples that would make it both easy to understand and simple to copy/paste a sample into a new console app to try it. Let’s jump in. Don't you feel smarter now?
|
|
|
|
|
Telerik wrote: Let’s jump in.
No, let's not.
|
|
|
|
|
|
nameOf very good
Filtered exceptions - good but can encourage bad habits
Not sure about the rest...time will tell?
|
|
|
|
|
I also like string interpolation a lot...
$"The sum of {a} and {b} is {a + b}."
|
|
|
|
|
That's dreadful.
|
|
|
|
|
I agree.
You have just been Sharapova'd.
|
|
|
|
|
PIEBALDconsult wrote: That's dreadful. The feature, or the sample?
|
|
|
|
|
|
Duncan Edwards Jones wrote: time will tell? I don't see myself to be using any of those in near future except "nameOf" and "await in catch and finally".
You have just been Sharapova'd.
|
|
|
|
|
Agent__007 wrote: "await in catch and finally".
I don't feel the article linked articulated that one well - I shall look it up..certainly error handling is something that needs fixing in async code.
|
|
|
|
|
|
Does anyone find "using static" to be helpful?
If yes then in what circumstances?
I just can't find any reason to use it... even in that very common example ("using static System.Console", which everyone that has posted a C# 6 feature used, I find it's much worse to read it in this manner.
There are some nice features, like Auto-Property initializers it could be helpful for creating a readonly properties, but the only extremely helpful thing (at least to me) is the introduction of nameOf...
|
|
|
|
|
I can´t imagine using it for Console.WriteLine or something, but I think importing extension methods from a class instead of a namespace makes much more sense. Like:
using static System.Linq.Enumerable;
|
|
|
|
|
I see what you mean, so for example if we have one large Extensions namespace with this we could clarify or emphasise exactly which extensions we are using.
Well that could be helpful.
Thanks for the reply.
|
|
|
|
|
Only as far as the developer allows.
|
|
|
|
|
That's why I separate each of my Extension Methods (with overloads) into its own namespace -- I really can't stand having a whole load of crap brought in when I want only one small piece of crap.
But then I also don't like the implementation of Extension Methods requiring the using directive, and the C# implementation not directly using the Attribute (unlike VB.net).
|
|
|
|
|
I also keep them in separate namespaces, it's much cleaner.
But nevertheless I do recall seeing some huge extension containers and I presume this could arrange a bit those big piles of mess...
|
|
|
|
|
While a lot of these new features do have a valid use, I have reservations about the language being extended with a whole set of new terse operators. If that continues, we may end up with something as unreadable as Perl.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Rob Grainger wrote: If that continues, we may end up with something as unreadable as Perl.
I hate Perl with a vengeance!
Kevin
|
|
|
|
|
Kevin McFarlane wrote: Perl with a vengeance
Isn't that Perl 6?
|
|
|
|
|
I think the Exception Filters example is a little contrived. You can achieve the same behaviour by simple catching specific exceptions in your catch block.
Here is some code that I have used in my WCF client for handling WCF exceptions.
try
{
}
catch (FaultException<UnexpectedServiceFault> ex)
{
Console.WriteLine("Error occurred: {0}", ex.Message);
Console.WriteLine("service message: {0}", ex.Detail.ErrorMessage);
Console.WriteLine("source: {0}", ex.Detail.Source);
Console.WriteLine("target: {0}", ex.Detail.Target);
Console.WriteLine("stack trace: {0}", ex.Detail.StackTrace);
}
catch (CommunicationException ex)
{
Console.WriteLine("Communications error occurred: {0}", ex.Message);
}
catch (TimeoutException ex)
{
Console.WriteLine("Service has timed out");
Console.WriteLine(ex.Message);
}
catch (Exception ex)
{
Console.WriteLine("Error has occurred");
DumpExceptionDetails(ex);
} Surely this is cleaner and easier to read than using C#6 Exception Filters.
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare
Home | LinkedIn | Google+ | Twitter
|
|
|
|