2. • Cloud Division Leader @ CodeValue
• Software architect, consultant and instructor
• Software Engineering Lecturer @ Ruppin Academic Center
• Author of Rx.NET in Action (Manning)
• Visual Studio and Development Technologies MVP
@tamir_dresher
tamirdr@codevalue.net
http://www.TamirDresher.com.
About Me
3. Agenda
What’s new for Application Developers & DevOps
Other Announcements ad Updated (Tools, Data, AI & ML)
C# 7.2 & 8.0
3
5. Visual Studio 2017 Version 15.6 Preview
https://blogs.msdn.microsoft.com/visualstudio/2017/12/07/visual-
studio-2017-version-15-6-preview/
Some profiling improvements
Team explorer git features
pull-request review in VS
Git tags
Bug fixes
Xamarin improvements
6
6. Visual Studio App Center
https://www.visualstudio.com/app-center/
Automate the lifecycle of your iOS, Android, Windows, and macOS
apps.
build, test, distribute to beta testers and app stores, and monitor. All in
one place.
Crash reporting & analytics
Continuous integration builds
Continuous deployment to groups of testers / store
Automated testing using the device cloud
Targeted push notifications
7
15. VSTS Git Forks
A fork is a complete copy of a repository, including all files, commits,
and (optionally) branches.
Forks are a great way to isolate experimental, risky, or confidential
changes from the original codebase.
16
16. GVFS - Git Virtual File System
The Git client was never designed to work with repos with many files or
large amount of content.
Windows codebase has over 3.5 million files and is over 270 GB in size
when you run “git checkout” and it takes up to 3 hours, or even a simple “git
status” takes almost 10 minutes to run.
GVFS virtualizes the file system beneath your repo
Files will only be downloaded when needed
17
26. C# Access Modifiers
What are the C# access modifiers? How many?
public - Access is not restricted
private - Access is limited to the containing type
protected - Access is limited to the containing class or types derived from the
containing class
internal - Access is limited to the current assembly
protected internal - Access is limited to the current assembly or types
derived from the containing class
(*new) private protected - Access is limited to the containing class or
types derived from the containing class within the current assembly
27
27. Readonly structs
A read-only struct is a struct whose public members are read-only, as
well as the “this” parameter.
28
public readonly struct ReadOnlyPoint
{
public int X { get; }
public int Y { get; }
public ReadOnlyPoint(int x, int y)
{
X = x;
Y = y;
}
}
28. Readonly structs
A read-only struct is a struct whose public members are read-only, as
well as the “this” parameter.
29
public readonly struct ReadOnlyPoint
{
public int X { get; set; }
public int Y { get; set; }
public ReadOnlyPoint(int x, int y)
{
X = x;
Y = y;
}
}
29. Readonly arguments
Problem:
30
public static MutablePoint Add(MutablePoint point1, MutablePoint point2)
{
point1.X += point2.X;
point1.Y += point2.Y;
return point1;
}
Add(x1, x1);
Caller has no way of telling
that this is being modified
public static MutablePoint Add(in MutablePoint point1, in MutablePoint point2)
{
point1.X += point2.X;
point1.Y += point2.Y;
return point1;
}
Solution:
30. Readonly arguments
Problem:
31
public static MutablePoint Add(MutablePoint point1, MutablePoint point2)
{
point1.X += point2.X;
point1.Y += point2.Y;
return point1;
}
Add(x1, x1);
Caller has no way of telling
that this is being modified
public static MutablePoint Add(in MutablePoint point1, in MutablePoint point2)
{
return new MutablePoint(point1.X + point2.X, point1.Y + point2.Y);
}
SafeAdd(in x1, in x1);
Solution:
31. Readonly structs
A read-only struct is a struct whose public members are read-only, as
well as the “this” parameter.
In short - a feature that makes this parameter of all instance members of a
struct, except for constructors, an in parameter.
public readonly struct ReadOnlyPoint
{
public int X { get; set; }
public int Y { get; set; }
public ReadOnlyPoint(int x, int y)
{
X = x;
Y = y;
}
}
32. Nullable reference types
Do you see a problem with this code?
33
public static void PrintNames(IEnumerable<Person> people)
{
foreach (var person in people)
{
PrintInCapital(person.FirstName);
PrintInCapital(person.MiddleName);
PrintInCapital(person.LastName);
}
}
public class Person
{
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
}
public static void PrintInCapital(string s)
{
Console.WriteLine(s.ToUpper());
}
Potential
NullRefenceException
33. Nullable reference types - motivation
Do you see a problem with this code?
34
public static void PrintNames(IEnumerable<Person> people)
{
foreach (var person in people)
{
PrintInCapital(person.FirstName);
PrintInCapital(person.MiddleName);
PrintInCapital(person.LastName);
}
}
public class Person
{
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
}
public static void PrintInCapital(string s)
{
Console.WriteLine(s.ToUpper());
}
Potential
NullRefenceException
34. Nullable reference types
Allow developers to express whether a variable, parameter or result of
a reference type is intended to be null or not.
Provide warnings when such variables, parameters and results are not
used according to that intent.
35
public class Person
{
public string FirstName { get; set; }
public string? MiddleName { get; set; }
public string LastName { get; set; }
}
var valid=new Person{FirstName = "Bart", MiddleName = null, LastName = "Simpson"};
var invalid=new Person{FirstName = "Madone", MiddleName = null, LastName = null};
PrintInCapital(person.MiddleName);
35. Span<T> and Memory<T>
How many allocations are made?
Allocations put pressure on the GC and effects your application
performance
36
string input = "Tamir,Dresher";
int commaPos = input.IndexOf(',');
int first = int.Parse(input.Substring(0, commaPos));
int second = int.Parse(input.Substring(commaPos + 1));
String
allocation
String
allocation
36. Span<T> and Memory<T>
Span<T> is a safe and Performant wrapper over a contiguous regions of
arbitrary memory. Can only live on the stack
Memeory<T> is like Span<T> but can live on the heap
37
string input = "Tamir,Dresher";
ReadOnlySpan<char> inputSpan = input.AsSpan();
int commaPos = input.IndexOf(',');
int first = int.Parse(inputSpan.Slice(0, commaPos));
int second = int.Parse(inputSpan.Slice(commaPos + 1));
Pointer
Length
37. Summary
What’s new for Application Developers & DevOps
Other Announcements ad Updated (Tools, Data, AI & ML)
C# 7.2 & 8.0
Private protected
Readonly structs and arguments
Nullable reference types
Span<T>
38
@tamir_dresher
tamirdr@codevalue.net
http://www.TamirDresher.com.