Visual Studio 2015 and C# 6.0 Condensed Summary of Changes

niemiro

Senior Administrator, Windows Update Expert
Staff member
Joined
Mar 2, 2012
Posts
8,770
Location
District 12
Just wanted to say that I found the following very mini (49 Powerpoint slides effectively) eBook to be an extremely well presented summary of changes. The Developer's Guide To The New .NET

In particular, the ten or so pages surrounding C#6.0 were particularly well done. I came across it through an advertising campaign but thought it good enough to share.
 
Glad to see they have not added too much :lolg:

I'm just now getting familiar with what they added in C#5 and don't want to do it all again.
 
Lol. To be honest I lost track a while back. I'm not coding anything in C# at the moment. I'm keeping up with C++0x/11/14 etc. but not so much C#. I'll brush up on it when I next code something in the language.
 
The big thing that I have used with gen 5 vs 4 is async and await. (For concurrency control)

The only thing that was covered in that handout that interested me was debugging for lambda functions although they tend to be pretty straight forward so I probably wouldn't use it much.

Interestingly, I haven't touched C++ in 2 years, I've been mostly using C/Java/C#/ASP/PHP/Python/etc
 
Another thing worth noting is that compiler optimization have improved alot over visual studio 2015.

When compiling something like this, in VS 2013 with default optimization settings:
Code:
int main()
{
    for (int i = 0; i < 10; i++)
    {
        printf("test");
    }

    getchar();
}
Would result in:
Code:
push esi
push edi
mov edi,[_imp__printf]
mov esi,0000000A
lea ecx,[ecx+00] // useless code, this is generated to align the push below it with an even number of bytes.

repeat:
push offset
call edi
add esp,04
dec esi
jne repeat
call dword ptr [_imp__getchar]
pop edi
xor eax,eax
pop esi
ret
40 bytes

However, VS 2015/(Express) optimization is much more efficient, and would result in:
Code:
push esi
push 0A
pop esi


repeat:
push offset
call dword ptr [_imp__printf]
pop ecx
sub esi,01
jnz repeat
pop esi
jmp dword ptr [_imp__getchar]
26 bytes.

Ofcourse this is just one example out of many, just think that this should also be noticed.
 
The best things for me is string interpolation and the null conditional operator for C# 6.0. It should be noted that there was the RyuJIT bug as well
(link).
 

Has Sysnative Forums helped you? Please consider donating to help us support the site!

Back
Top