►
From YouTube: S103 - What's Coming to C#?
Description
Over the last year we shipped point releases of C#, full of small but useful language features. Mads will recap some some of these, before turning to the big things we have in store for the future: Nullable reference types, recursive patterns, asynchronous streams and more.
A
Hey
welcome
back
for
those
of
you
who
weren't
here
for
the
keynote
I'm
master,
Gerson
and
I'm
the
lead
designer
for
the
c-sharp
language.
So
the
next
hour
we're
gonna
spent
talking
about
some
of
the
things
that
we
recently
added
to
c-sharp
and
some
of
the
things
that
we're
planning
to
add
and
hopefully
there'll
be
time
for
a
few
questions
from
you
guys
as
well.
So
when
we
look
at
the
stack,
the
stack
overflow
survey
that
goes
out
every
year
to
developers,
I
always
like
to
open
that
up
and
see.
A
How
are
we
doing
with
c-sharp
here's,
the
top
many
languages,
I
I've
sliced
out
the
ones
that
I
don't
consider
to
be
programming
languages?
And
this
is
what
you
is,
what
you
get.
So,
if
you
look
at
the
most
popular
programming
languages
and
ones
that
most
people
use,
or
at
least
most
developers,
who've
responded
to
the
survey
you
can
see
that
c-sharp
is
prominently.
Figured
there.
It's
a
lot
of
people
using
c-sharp
and
we're
happy
to
note
that
more
and
more
of
them
are
using
c-sharp
cross-platform
on
many
different
platforms.
A
We
also
look
at
the
most
loved
programming
languages.
This
is
where
the
smaller
languages
get
to
play,
because
this
is
measured
in
terms
of
the
percentage
of
users
who
would
like
to
continue
using
that
language
and
we're
happy
to
see
that
c-sharp
is
represented
here
as
well.
So
we
are
in
a
in
good
shape
in
terms
of
both
people
using
c-sharp,
but
also
liking
it
and
not
just
doing
it,
because
they
have
to
sometimes
it's
interesting
to
look
at
some
of
the
other
languages
that
are
on
here.
A
If
you
think
about
other
languages
that
are
on
both
of
these
top
tens,
pythons
been
there
along
with
c-sharp
for
a
couple
years.
Last
year,
typescript
joined
so
yay
go
Microsoft.
You
also
see
f-sharp
down.
There
is
one
of
the
most
loved,
though
it's
not
quite
made
the
top
ten
in
terms
of
usage.
Yet
and
this
year
a
couple
more
joined.
A
The
swift
language
essentially
has
been
loved
for
a
while
now
rose
to
higher
usage
and
the
JavaScript
language,
a
lot
of
people
very
happy
with
the
JavaScript
language
now
so
that
was
a
little
baffling
to
us,
but
I
think
that
there's
a
common
trend
among
many
of
these
languages,
which
is
that
we,
we
all
take
quite
an
aggressive
approach
to
evolution
and
making
sure
that
there
are
all
the
tools
in
the
box
for
for
people
to
use
in
professional
development.
So
that
leads
us
to
what
is
the
strategy
for
c-sharp?
A
Actually,
what
are
we
thinking
about?
What
are
the
the
goal
posts
that
we
we
use
when
we
think
about
what
to
do
with
c-sharp
the
language
itself,
as
well
as
the
platform
around
it,
and
that's
actually
a
link
here
which
you
can
go?
Click
that
take
you
to
where
we
post
our
language
strategy
for
c-sharp,
visual,
basic
and
F
sharp.
So
you
can
can
compare
I
pulled
out.
Some
of
the
main
phrases
here
for
for
C
sharp,
which
is
first
and
foremost,
will
keep
growing
C
sharp.
A
So
we're
not
afraid
to
sometimes
take
the
lead
and
introduce
a
new
feature,
a
new
kind
of
feature
that
other
languages
can
then
use
to
to
move
their
needle
as
well
as
you've
seen
that
several
times
over
the
years
with
c-sharp,
it's
important
for
us
to
recognize
that
we
have
a
very
broad
set
of
developers.
We
have
great
diversity
in
the
developer
base,
and
so,
therefore,
we
have
to
focus
our
improvements,
mostly
on
things
that
benefit
all
developers
or
most
developers.
A
So
this
is
clearly
something
that's
evolved
over
the
years
now
we're
completely
open-source,
and
if
we
get
time
we
can
go
and
look
a
little
at
that
as
well
later
in
the
talk,
their
language
to
sign
itself
is
open
source
and
there's
a
daily
dialogue
with
with
the
community,
rather
than
you
know,
every
two
or
three
years
when
we
would
release
a
new
version
and
hope
that
people
liked
it.
So
this
has
been
a
great
trend
for
us
and
that's
something
that
we're
quite
determined
to
to
keep
evolving
that
relationship
with
the
community.
A
That
said,
we
also
want
to
balance
this
with
continuing.
What
we
think
is
one
of
the
successes
of
c-sharp,
which
is
that
we
we
try
to
exercise
very
strong
stewardship
of
the
language
and
the
design
decisions,
so
that
there's
there's
one
body
of
designers
that
have
been
in
it
for
a
long
time
and
it
can
guarantee
continuity
and
coherence
of
the
language
as
it
evolves.
A
So
it's
not
sort
of
a
design
by
committee
of
democracy,
kind
of
design,
environment,
there's
still
a
little
group
of
us
that
are
making
the
ultimate
decisions
and
making
sure
that
all
the
people
who
are
more
interested
in
using
c-sharp
and
less
interested
in
evolving
it
that
they
get.
You
know
a
solid
experience
going
forward
and
they
get
a
well
curated
language
if
you
will
so
that's
kind
of
our
mindset
that
we
that
we
apply
when
we
go
into
language
design,
which
would
which
we
do
several
times
a
week.
A
So
here
are
kind
of
the
main
phrases
from
there.
Keep
drawing
C
sharp,
innovate
aggressively,
benefit
all
developers,
empower
the
ecosystem
and
show
strong
stewardship.
So
let's
talk
about
some
of
the
reasons
and
coming
versions
of
c-sharp.
So
over
the
last
year
and
a
bit,
we
released
no
less
than
three
point
releases
of
c-sharp,
that's
kind
of
a
new
thing
for
us
to
have
point
releases.
A
We
realized
that
we
had
a.
We
had
evolved
so
much
in
our
process
that
we
were
able
to
ship
more
often,
and
also
we
didn't
want
to
hold
back
value
that
you
know
developers
could
get
sooner
if
they
wanted
to,
while
at
the
same
time,
recognizing
that
smaller
steps,
maybe
shouldn't
be
something
that
everyone
was
forced
to
to
use.
So
we
reintroduced
this
divide
between
major
and
minor
versions.
A
We
also
had
some
specific
scenarios
that
that
span
across
all
of
the
dotnet
layers,
if
you
will
that
were
related
to
framework
and
runtime
work,
as
well
as
the
language
work,
and
we
wanted
to
ship
those
as
a
package,
and
so
this
was
a
good
time
to
exercise
doing
sort
of
out-of-band
releases
of
c-sharp.
If
you
will
so
that's
what
c-sharp,
7,
1,
72
and
73
were
about
more
specifically
the
sort
of
core
there
couple
of
like
driving
themes
here,
the
core
driving
theme
is
one
about
safe,
efficient
code.
A
So
this
is
a
feature
set
that
is
primarily
targeted
at
people
doing
somewhat
lower
level
programming
in
c-sharp,
so
they're
sort
of
the
direct
beneficiaries,
if
you
will,
but
because
they're
building
the
lower
levels
of
what
everyone
else
builds
on,
there's
direct
benefit,
certainly
in
terms
of
the
improved
performance
that
those
frameworks
can
get,
but
sometimes
also
the
abstractions
that
they
can
offer
a
better
because
of
these
features.
So
it's
something
that
has
a
positive
impact
on
everyone,
even
though
many
people
don't
need
to
relate
to
it.
A
So
much
so
we'll
spend
our
our
time
talking
about
seven
one.
Two
three
here
primarily
focusing
on
these
safe,
efficient
features
and
I'll
show
some
demos.
I
did
a
short
one
in
the
in
the
keynote
earlier
this
morning.
If
you
saw
that,
but
there
were
various
AV
difficulties
there,
so
I'll
try
to
get
that
whole
demo
flow
a
little
more
expanded
this
time
and
show
all
those
features.
A
They're
also
just
general
improvements
things
that
used
to
be
not
allowed
that
are
now
allowed,
such
as
using
delegate
or
enum
as
constraint
as
constraints
in
generics
and
many
more
things
and
they're.
Also
the
the
usual
set
of
nice
abbreviations
that
let
you
write
things
shorter
than
you
used
to
so
I
have
a
link
at
the
end
of
the
deck
where
you
can
go
and
look
at
our
Docs
at
Doc's
at
microsoft.com,
and
they
generally
have
very
good,
but
they
do
have
very
good
summaries
of
what's
new
in
the
individual
versions
and
so
on.
A
I
encourage
you
to
go
and
look
at
all
the
things.
I
don't
explain
here,
or
even
once,
I
do
and
kind
of
get
the
details
on
it.
So
then
that's
C,
sharp
8,
which
is
our
next
planned
version.
That's
coming
up
sometime
later
and
the
main
theme
here
is
for
it
just
to
be
magical
like
this
is
where
we
want
to
do
actually
a
not
very
close,
tight,
Lea
related
set
of
features
that
all
are
bigger
and
have
more
of
an
impact
on
how
you
program
and
hopefully
take
your
development
to
a
new
level.
A
So
I
allowed
myself
one
unicorn
today
here-
and
this
is
said
so
before
we
dive
into
that,
though.
Let's
take
that
thrower
look
at
C
sharp,
7,
1,
7,
2,
&
7
3.
So
let
me
go
into
visual
studio
and
start
out
with
this
particular
project
here.
So
I
want
to
talk
about
the
improvements
we
made
around
ref,
so
some
of
you
may
have
noticed,
there's
a
ref.
He
word
in
the
language.
A
You
probably
don't
use
it
very
much,
but
I'm
going
to
show
how
several
improvements
and
new
things
here
can
make
working
with
structs
a
lot
easier
and
a
lot
safer.
Like
give
you
a
lot
of
places
where
you
don't
need
to
reach
for
unsafe
code,
for
instance,
and
pointers,
and
then
building
on
that
we'll
talk
about
the
new
span
of
T
features
in
a
minute,
so
ref
is
really
a
feature
for
passing
things
by
reference
and
since
objects
are
already
passed
by
reference
like
you
never
copy
an
object
to
somewhere
else.
A
You
always
just
pass
a
reference
to
it.
This
is
primarily
interesting
for
struct.
So
if
you're
trying
to
improve
your
performance,
avoid
allocations
by
using
structs,
then
you'll
want
to
use
these
features,
and
if
you
don't,
because
you
were
at
a
higher
level,
then
be
thankful
that
somebody
further
down
are
doing
it
like
the
improvements
you
saw
in
a
tech
empower
benchmark,
for
instance,
in
nikinoo.
A
Those
derive
among
many
other
things
from
from
starting
to
adopt
these
features
here.
So,
just
as
a
reminder,
I
have
a
little
program
here
that
has
a
method
that
takes
two
int
and
returns
an
int
which
is
one
of
one
of
the
two
that
it
got
in
and
then
it
mutates
them
and
and
writes
a
few
things
out
and
let's
do
this
by
ref.
Instead
of
passing,
the
intz
by
value
will
now
pass
refs
to
the
int.
A
One
of
the!
Let
me
just
look
at
my
cheat
sheet
here.
Yes,
so
one
of
the
things
that
you
haven't
been
able
to
do
is
to
use
extension
methods
where
this
parameter
the
first,
the
receiver
of
the
extension
method
was
at
ref.
So
that's
something
that
we
added
recently,
so
you
can
now
say
this
here
and
then
you
get
an
extension
method
that,
if
I
choose
I,
can
go
and
call
it
with
a
as
a
receiver
and
now
I
need
to
remove
the
first
argument
and
I'm
passing
it
with
a
here
instead.
A
So
you
see
in
this
case
where
I'm
calling
as
a
receiver
I,
don't
have
to
say
ref
for
the
usage
of
a
here,
and
we
think
that's
alright,
because
when
you're
calling
things
as
an
instance
method,
you
were
kind
of
expecting
that
to
be
able
to
mutate
the
receiver.
So
we
think
that
sort
of
the
visual
cue
is
good
enough
without
having
to
sort
of
massage
the
ref
keyword
into
the
syntax
here
somewhere.
So
that's
extension
methods.
A
Another
thing
that
we
that
we
wanted
to
improve
was
using
refs
without
fear.
Okay,
so
I
talked
about
this.
This
fear
inducing
step
of
passing
your
actual
variable
to
someone
else.
Who
might
mutate
it,
which
is
the
case
here?
They
actually
do
mutate
it.
But
what
if
I
want
to
pass?
Let's
say
it's
not
int,
but
it's
a
big
struct
I
want
to
pass
it
by
ref
for
efficiency
sake,
but
I
don't
actually
want
them
to
mutate.
It
that's
something
that
we
then
went
and
added
new
features
for
in
c-sharp,
seven
two.
A
So,
instead
of
a
ref
parameter,
let's
say
we
want
for
Y
here,
want
to
protect
it
against
mutation.
I
can
pass
it
as
an
in
parameter,
and
now
that
means
that
still
passed
by
reference.
But
you
can
see
them.
The
method
is
no
longer
allowed
to
mutate
it,
so
the
mutation
of
it
is
forbidden,
and
that
means
that
the
method
here
or
the
main
method
here
can
safely
pass
it.
A
So
I'm
going
to
so
I,
don't
get
to
use
the
ref
keyword
anymore,
because
I'm
now
passing
it
by
in
so
to
speak,
so
I
can
use
the
in
keyword
instead
still
matching
that
doing
the
keyword
match
here,
and
that
means
you
know
I
acknowledge
that
they
can
see
whatever
changes
I
make
to
B,
but
they
can't
make
any
changes
themselves.
Now
that
looks
an
awful
lot
like
passing
things
by
value,
except
that
it's
more
efficient,
and
so
we
actually
do
allow
you
to
not
even
say
the
in
keyword.
A
You
don't
need
to
be
warned
in
syntax
that
you
are
passing
something
by
in,
because
the
people
you're
passing
it
to
won't
be
able
to
do
anything
with
it.
You
can
actually
omit
the
end
keyword
altogether
and
pass
just
the
variable
like
that,
and
in
fact,
if
you
do
that,
you
can
even
pass
something.
That's
not
a
variable
like
40
or
let's
just
use
42
here,
and
we
will
automatically
create
a
variable
in
the
background
and
pass
it
by
as
a
read-only
ref
to
the
to
the
mint
okay.
A
A
The
variable
itself,
so
I
can
do
that
by
returning
by
ref,
okay,
so
now
I'm
returning
either
in
this
case,
I'm
returning
X
by
ref
and
I,
have
to
acknowledge
that
by
returning
the
ref
to
the
X
variable
here
and
that's
fine,
but
here
I'm
still
so
I'm
returning
it
by
ref,
but
I'm
still
taking
the
value
and
putting
it
into
the
C
variable
here.
If
I
want.
A
If
I
want
the
ref
itself,
the
reference
to
the
variable
I
have
to
sort
of
take
the
ref
like
I,
do
when
I
pass
a
ref
parameter
and
then
I
have
to
declare
the
variable
as
being
a
ref
as
well.
So
now,
C
is
no
longer
a
variable
holding
an
int,
but
it's
a
variable
pointing
to
another
variable,
holding
an
int
right
and
which
variable
that
is.
That
comes
from
the
ref
initializer
here,
which
is
whatever
comes
back
from
the
or
maybe
method.
A
So
in
this
case
you
can
see,
since
it
returns
a
ref,
its
X
parameter,
which
we
passed
the
a
variable
for
that,
then
C
will
actually
be
an
alias
to
the
a
variable,
and
so
when
I,
when
I
increase
it
here,
we
can
try
running
it.
When
I
increase
the
variable
here,
you
can
see
that
the
a
variable
changes
as
well,
so
there
you
go,
you
can
see
that
a
and
C
are
aliases
to
the
same
variable
here.
A
So
in
general,
you
have
this
idea
that
a
ref
is
sort
of
like
a
window
onto
another
variable,
whether
you
have
some
storage
and
you
have
a
window
onto
the
storage
and
if
you
use
in
instead
of
ref,
is
the
windows
closed?
You
can
see
through
it,
but
you
can't
reach
through
it
and
manipulate
the
thing.
So
is
this
open
window
and
closed
window
analogy
that
we
can?
We
can
exploit
a
little
further
down
the
line
here.
A
The
thing
I
promised
here
by
saying
into
X
I
have
to
also
make
it
read
only
when
I
return
it
back
out
again
in
order
for
the
squiggle
there
to
go
away
and
then
I
can't
mutate
that
one
either.
So
you
see
how
it
all
hangs
together
the
protection,
the
extra
protection
of
in
and
of
read-only
kind
of
flows
through
the
whole
thing
and
guarantees
that
the
only
mutate
things
that
you
that
you
want
to
now.
That
was
a
whole
lot
about
ref,
and
why
is
that
interesting?
A
A
So
let's
go
in
and
try
to
play
with
span
in
this
program,
and
this
is
the
demo
that
didn't
work
out
so
well
in
the
keynote
this
morning,
and
hopefully
it
works
out
better
today.
So,
if
we're
going
to
look
at
a
rate
you
can
see,
there
are
a
couple
of
new
extension
methods.
One
of
them
is
as
span
which
lets
me
get
a
span
from
the
array
whatever
that
means,
so
a
span
return
to
span
of
int.
A
Let's
grab
that
span
of
int
into
it
variable
call
it
span,
and
now
what
we
have
is
essentially
an
alias
for
the
array.
It's
a
window
onto
the
same
elements
and
we
can
see
that
by
writing
out
the
elements
in
the
span
instead
of
the
ones
in
the
array,
and
you
should
be
able
to
still
see
the
initialized
values
here
from
0
to
9,
even
though
the
even
though
I
I
took
the
span,
if
you
will
before
I
initialize
the
array.
A
So
if
the
span
had
copied
over
values,
it
would
still
be
all
zeros
if
you
want
to
further
assure
yourself
of
it.
We
can
also
turn
it
around
and
actually
initialize
through
the
span
and
write
out
the
elements
of
the
array,
and
you
can
see
I'm
by
initializing
through
the
span
I'm
reaching
through
the
window
and
manipulating
the
array
that
the
span
points
to
that.
It's
an
open
window
too.
A
If
you
will
and
just
like
just
like
well,
let's
get
to
that
in
a
second,
but
one
of
the
things
that
you
might
want
to
think
about
is
what
can
you
then
do
with
this
ban?
Well,
you
can
do
many
of
the
same
things
that
you
can
do
with
an
array,
but
you
can
also
do
other
things,
and
one
of
the
things
you
can
do
is
that
you
can
slice
them.
So
I
can
take
a
slice
of
a
span,
for
instance,
from
the
third
element
and
and
five
elements
on
from
there.
A
And
what
that
returns
to
me
is
another
span.
That's
only
two
part
of
the
array,
so
it's
still
two
some
of
the
same
memory
locations
but
am
but
with,
but
with
some
of
them
sliced
out,
and
so,
if
I,
if
I
write
out
the
elements
of
the
slice
here,
you
can
see
that
I
only
get
the
ones
from
three
to
seven,
which
are
the
ones
that
I
sliced
out
but
I'm
still
looking
at
the
elements
that
only
got
initialized
after
I
created
the
slice.
A
A
The
thing
that's
kind
of
missing
here
still
that
was
in
the
ref
story,
is:
if
I
pass
a
span
to
someone,
how
can
I
prevent
them
from
modifying
the
thing
that
the
span
refers
to
and
similar
to
ref
read
only
is
there's
a
read-only
span,
type
that
you
can
just
convert
your
span
to
and
that
prevents
modification.
So
you
can
see
that
if
I,
if
I
make
the
slice
a
read-only
span,
then
I
don't
get
to
reach
through
the
window
and
manipulate
it
all
right.
So
that's
that
that's
the
deal
with
the
span
here.
A
There's
one
c-sharp
eight
feature
that
I'm
actually
gonna,
that
I
can't
show
you.
Today
we
have
shown
it
before,
but
the
bits
are
currently
in
a
state
where
I
can't
demo
it,
but
is
going
to
be
quite
interesting
in
connection
with
this,
as
well
as
many
other
things,
and
that
is
that
indexing
in
c-sharp
it's
kind
of
basic.
You
can
pass
like,
for
instance,
to
an
array
you
can,
you
can
or
a
span
here
you
can
pass
an
int
and
you
get
that
number
element.
A
One
thing
you
can't
do
is,
for
instance,
say
I
want
the
third
element
from
last.
You
have
to
do
your
own
math
in
order
to
compute,
based
on
the
length
the
current
length
of
the
array
or
the
span.
You
have
to
compute
the
third
element
from
last,
so
we're
introducing
a
little
syntax
to
do
that.
It's
not
going
to
work
here,
but
I'm
going
to
type
it
anyway.
A
You
want
here
and
the
ranges
are
also
planned
to
be
open-ended
optionally.
So
you
can
say
three
dot
dot
from
three
to
the
end
or
you
can
say
from
the
beginning
to
seven
or
you
can
actually
just
say
all
of
it.
So
there's
a
range,
that's
open
on
both
sides.
It
just
means
get
me
the
whole
thing,
which
is
you
know
something
that
you
you
might
want
to
do.
A
There
we
go
luckily
I
didn't
need
to
factor
authorization
here,
I
would
have
taken
a
while.
So
here
is
a
this
is
on
a
remote
machine
and
that's
because
the
the
bits
aren't
working
on
my
machine
right
now.
But
this
is
an
example
of
a
program
that
looks
completely
innocent
and
innocuous,
but
it's
actually
dangerous,
and
this
is
the
the.
A
A
So
that
looks
fine
and
there
are
no
flashing
warning
signs.
But
if
I
compile
and
run
it,
then
you
probably
won't
be
surprised
because
you're,
probably
a
scarred
as
I,
am
that
you
will
well
once
we're
done
compiling.
We
won't
actually
get
the
length
of
Miguel's
non-existing
middle
name,
we'll
get
in
a
rut:
I'm
exception,
that's
a
null
reference
exception
and
and.
A
That's
something
that's
we've
gotten
so
used
to,
but
it's
still
very
hard
to
keep
the
null
reference
exceptions
out
of
our
production
code,
because
we
don't
have
proper
tools
at
development
time
to
kind
of
minimize.
The
situations
where
we
accidentally
run
into
a
null
this
kind
of
situation
is,
is
a
little
hard
because
it's
unclear
who's
to
blame
here
is:
it
is
the
method
here
to
blame
for
getting
the
length
of
the
middle
name
or
is
the
is
the
constructor
to
blame
for
putting
a
null
in
there
in
the
first
place?
A
A
So
that's
where
we
figured
it's
time
for
some
more
expressiveness
in
c-sharp
and
two
to
have
a
feature
that
helps
you
deal
with
that,
and
so
let's
go
and
look
at
that
person
class
and
start
from
there
there's
a
new
feature
in
town.
It
gives
you
extra
warning,
so
you
kind
of
have
to
turn
it
on,
and
that
feature
is,
is
nullable
reference
types.
A
So,
in
order
to
turn
that
on
I
I
use
an
attribute
here
so
at
the
module
level,
I'll
specify
the
attribute,
none
all
types
and
that
attribute
what
it
says
is
that,
with
this
attribute
we're
going
to
start
considering
all
your
reference
types
to
be,
none
nullable
and
we're
gonna.
Warn
you!
If
we
see
you
sticking
nulls
in
them,
okay,
so
we
are
strengthening
the
contract
around
all
the
reference
types
that
are
in
your
code
today
saying
from
now
on
we're
not
gonna.
Let
them
be
null
any
longer.
A
We're
not
gonna,
give
you
errors,
but
we're
gonna
give
you
warnings
to
help.
You
not
do
that.
So
obviously
that
can
only
be
part
of
the
story,
but
it's
a
pretty
useful
part
of
the
story
and
we'll
get
to
the
other
half
in
a
little
bit.
So
what
you
see
now
that
I
have
that
turned
on
I,
get
a
warning
on
the
person
constructor
here
that
only
initializes
the
first
and
last
name
and
the
warning
says
you
are
not
initializing
the
none
nullable
property
middle
name.
You
are
not
making
it
not
null
well.
A
I
can
go
and
fix
that
warning.
Real
quick
I
can
initialize
it.
A
middle
name
equals
null
now
I,
don't
get
the
warning
anymore.
All
right,
I
get
another
warning,
saying:
hey
you
can't
put
a
null
in
there
either.
You
can't
leave
it
all,
and
you
can't
put
it
all
well,
what
can
I
do
then?
This
is
the
other
half
of
the
story.
Well,
I
can
declare
to
the
world
that
it
is
supposed
to
be
null
okay,
so
I
can
put
a
question
mark
on
the
string
type
on
this
reference
type.
A
Just
like
you
already
can
with
value
types,
and
that
is
how
I
declare
that
the
middle
name
is
in
fact
nullable
it's
supposed
to
sometimes
be
null
and
whoever
consumes
it
better.
Take
that
into
account.
They
can't
trust
it
to
be
there.
The
way
that
first
name
and
last
name
can
be
trusted
because
I
always
initialize
those.
A
So
now
you
see
the
warning
went
away
on
the
initialization
here
and
even
if
I
didn't
have
the
initialization
I
wouldn't
get
the
warning
on
a
constructor,
because
it
only
cares
if
the
none
nullable
reference
fields
are
in
issue.
So
so
far,
so
good
I
owned
up
to
my
nullity
in
the
in
the
surface
area
of
the
type
that
I'm
using.
How
can
I
then
make
use
of
that
when
I
consume
it?
A
Well,
you
see
another
warning
here,
saying:
hey
you
possibly
dereferencing
a
null
reference
here,
peanut
midlane
might
be
null
yet
your
dot
lengthing
it.
You
should
be
doing
that.
Well,
I,
guess,
they're
right!
Okay,
since
the
since
the
surface
area
of
the
type
that
I'm
consuming
is
now
has
now
been
detailed
to
specify
the
null
ability.
I
no
longer
have
any
excuse
here
when
I'm
consuming
it,
I
can't
be
in
doubt
as
to
whether
I
need
to
handle
nulls
or
not
in
any
given
case.
A
The
fact
of
the
matter
is:
first
names:
I,
don't
need
to
handle
nulls
middle
names,
I
do
the
the
signature
says
so,
and
so
now
it's
on
me
to
fix
this
bug.
Now
we
didn't
want
to
add
new
fancy
features
to
c-sharp
for
fixing
this
bug
like
we
wanted
to
be
able
to
recognize
the
ways
that
you
already
check
for
null
today.
A
So
it
should
be
that
if,
if
you
write
null
safe
code,
the
way
you've
always
done
it,
then
we
will
recognize
that
and
we
won't
give
you
warnings
and
so
that
kind
of
leads
us
to
introducing
this
feature
of
a
flow
analysis
that
will
try
to
track
the
value
of
different
variables
and
properties
and
throughout
the
the
flow
of
a
method
and
we'll
try
to
see
where
they
can
possibly
no
be
null
and
where
they
can't
and
where
they
can't
possibly
be
null.
We
won't
give
you
warnings
on
a
due
reference.
A
So
let's
put
that
to
the
test.
So
literally
a
test
here,
I'm
gonna,
say
if
Peter
this
is
one
of
the
ways
that
I
might
fix
it.
If
Peter
middle
name
is
null
remember
always
using,
is
not
double
equals
for
null
tests
unless
you're,
absolutely
certain
that
there's
no
user
defined
override
of
the
equals
operator
better
to
use
is
it
always
does
a
null
check
properly
now,
if
it's
null
then
return
something
else,
let's
say
zero.
A
Let's
say:
that's
default
value,
and
now
you
see
the
warnings
go
away,
because
the
compiler
can
see
that
if
you
ever
get
here,
then
Peter
middle
name
clearly
wasn't
null.
So
this
is
one
way
of
fixing
it,
but
either
way
you
try
will
will
have
the
same
effect.
If
we
move
that
and
instead
we
say
I
mean,
if
you
put
the
if
in
front
here
and
invert,
the
condition
that
will
work
too,
but
let's
try
some
more
creative
ones.
A
But
if
we
want
to
keep
it
in
the
family
here,
keep
it
inside
of
the
method.
Then
another
thing
I
could
do.
Another
thing
I
could
do
is
to
use
the
null
coalescing
operator
and
saying
hey.
If
the
left
hand
is
null,
then
use
zero
instead
and
now
boom,
they
all
the
warnings,
go
away
and
I
have
an
int.
That's
either
zero.
A
If
the
thing
was
null
or
that's
the
length,
if
the
thing
was
not
null
and
again,
the
the
compiler
has
is
tracking
all
the
conditional
logic
here
and
making
sure
that
hey,
you
are
not
dereferencing
anywhere
that
you
don't
know
the
thing
to
be,
none
null.
So
that's
the
core
of
the
feature.
The
combination
of
the
ability
to
specify
your
intent
is
it
null?
Is
it
supposed
to
be
null
or
is
it
never
supposed
to
be
null?
A
So
you
specify
that
by
having
a
question
mark
or
not
on
your
reference
type
and
then
combine
that
with
the
ability
to
check
the
usage
of
everything,
that's
declared
in
that
way
and
making
sure
that
you
use
it
according
to
the
declared
intent,
you
get
a
warning
if
you,
if
you
put
a
null
in
where
you're
not
supposed
to
you,
get
a
warning
if
you
dereference
something
that
is
not
known
not
to
be
null.
That
might
be
not
okay.
A
So
and,
as
you
saw
this
because
this
feature
adds
new
warnings,
we
need
to
make
it
up
tin
in
some
form,
because
we
can't
just
like
ship
a
new
version
of
c-sharp
and
all
of
a
sudden,
you
start
getting
new
warnings.
That's
a
breaking
change
and
people
really
do
not
like
breaking
changes
and
we've
been
avoiding
them
so
far.
So
let's
keep
doing
that,
and
so
you
have
to
explicitly
opt-in
by
somewhere
in
your
assembly,
specifying
the
module
level
attribute.
Non-Null
types
you
can
actually
the
the
attribute
is
a
little
more
granular
than
that
in.
A
If
you,
if
you
have
like,
say,
let's
say
you
have
a
gigantic
library,
lots
of
public
surface
area
and
you
kind
of
want
to
go
gradually
opting
into
the
whole
reference
type
is
none
null
default
on
a
class-by-class
basis.
For
instance,
you
can
put
this
attribute
more
granularly
on
a
class
or
even
on
a
method,
and
you
can
even
give
it
a
false
argument
to
opt
out
for
a
certain
scope
of
code
and
that
way
sort
of
in
a
transition
period.
A
You
don't
have
to
sort
of
own
the
whole
Nala
bility
problem
for
all
of
your
code.
At
the
same
time,
you
can,
you
can
gradually
roll
into
it.
So
that's
it.
That's
something
we're
sort
of
finishing
the
design
of
right
now
and
they're.
Also
also,
sometimes,
methods
don't
have
like
clear
null
ability
behave.
Sometimes
they
have
special
behavior
with
respect
to
null.
For
instance,
you
know
the
is
null
or
empty
method
on
string.
A
Well,
it
actually
guarantees
that
if
it
returns
false
and
thing
isn't
null,
but
there's
no
way
the
compiler
can
know
that
by
looking
from
the
outside,
and
so
we're
also
fiddling
with
special
attributes.
So
you
can
put
on
special
methods
and
further
detail
their
null
behavior
till.
Let
them
tell
you
extra
things
about
what
comes
what
goes
in
and
what
comes
out.
So
that's
all.
It's
still
in
the
works
for
when
this
ships
into
char
baked.
So
that's
not
reference
types
and
that's
probably
that's
the
feature
that
is
most
done
and
also
it's
a
very.
A
We
think
it's
a
very
potent
feature
we're
looking
very
much
forward
to
rolling
it
out.
So
now,
let's
go
back
to
slides
and
look
at
some
of
the
other
features
that
we're
planning
for
C
char
bait
and
then
have
a
little
time
for
questions
at
the
end
here.
So
if
we
hop
in
here
and
go
and
project
and
now
the
feature
that
we're
we're
quite
excited
about
is
the
ability
to
better
evolve
interfaces,
so
the
feature
is
called
default
interface
members.
A
One
of
the
problems
with
interfaces
is
that
you
can
never
add
a
new
member
to
an
interface,
because
all
the
existing
implementers
will
then
be
broken.
There
won't
be
implementing
the
new
member
so
once
you
have
an
interface
and
it's
published
you're
kind
of
stuck
with
it
and
that's
a
little
harsh,
so
we
want
to
introduce
a
way
that
you
can
soften
that
up
a
little
bit
and
that's
what
default
interface
members
are
for.
A
Is
that
I
specify
a
default
implementation
as
a
default
implementation
here
in
terms
of
a
method
body
that
uses
the
other
members
on
the
interface
to
implement
some
sort
of
default
behavior,
and
then
my
existing
console
logger
they're
not
affected
at
all.
In
fact,
we're
going
to
put
this
into
the
runtime
so
that
they
don't
even
have
to
be
recompiled.
They
will
just
automatically
get
the
new
member
with
the
default
implementation
when
seen
from
an
assembly
that
knows
about
the
new
member,
so
run
time
make
sure
it's
there.
A
On
the
other
hand,
though,
the
the
the
member
can
of
course
be
implemented,
then
the
default
implementation
just
doesn't
doesn't
play
in
at
all.
So
here
we
are
explicitly
adding
an
implementation
of
that
interface
member
and
you
just
never
knew
there
was
an
in
that
case.
You
never
knew
that
wasn't
a
default
implementation,
so
we
think
that's
a
good
feature
for
softening
up
the
evolution
of
interfaces
and
also
maybe
I
think
you
might
think
about
designing
our
interfaces
a
little
differently
offering
a
few
more
methods.
A
Maybe
then
you
usually
would,
because
you
don't
be
quite
a
sparse,
you
can
offer
more
members
that
have
sort
of
default
implementation
and
it's
still
as
easy
for
implementers
to
to
implement
the
remaining
behaviors.
So
that's
that
one
another
thing
that
we've
been
looking
at
for
a
while
is
that
there's
sort
of
sort
of
a
hole
in
our
story
around
a
sink?
A
If
you
will,
we
introduced
a
sink
to
the
language
in
c-sharp
5
and
that's
the
notion
there
in
the
framework
of
a
task
of
T
task
of
int,
for
instance,
task
of
string,
which
is
essentially
an
asynchronous
result.
It's
something
that
you
can
await
and
then
at
some
point
in
the
future,
it
will
produce
a
single
value
that
then
the
await
language
feature.
A
We're
also
not
shown
here,
but
we're
also
going
to
update
iterators
the
things
that
can
produce
I
know
Mobile's
today
by
doing
yield,
return
we're
going
to
also
make
a
version
of
that
that
can
produce
ia
sync
and
no
more
goals
in
the
same
manner,
so
language
support
for
these
asynchronous
streams
and
then
as
a
sort
of
very
related
point.
Another
thing
that
you
can't
do
synchronously
today
is
disposal.
You
have
the
I
disposable
interface
and
it
forces
you
to
have
a
synchronous,
dispose
method.
Well,
what
if
disposal
includes
like
closing
a
file
or
something?
A
That's
inherently
async
and
you
want
you
know
when
you
have
a
using
clause,
you
want
to
wait
after
the
using
Clause
ends.
You
want
to
wait
for
that.
All
to
have
happen.
You
want
to
know
that
disposal
is
complete.
It's
not
a
real
good
mechanism
for
that
today.
So
we're
going
to
also
introduce
is
ink
disposable
as
an
interface
and
using
a
weight
as
a
mechanism
to
consume
and
asynchronously
disposable
object
and
it'll
work
exactly
the
same
way.
It
awaits
the
disposal.
A
There's
gonna,
be
a
dispose,
async
method
in
there
somewhere
it
weights
that
at
the
end
of
the
using,
so
that
the
next
line
after
won't
be
executed
until
that
all
that
asynchronous
disposal
has
happened.
So
that's
the
async
story
that
we're
looking
at
and
there's
still
questions
in
there
around.
How
far
do
we
go
with
async,
link
and
stuff,
like
that,
on
top
of
the
I
think
you
know
mobile,
that's
all
being
worked
out
also
for
C,
sharp
8
and
again
this
all
happens
in
the
open.
A
A
Another
feature
that
was
a
really
good
start,
I,
think
and
kind
of
covered.
The
80%
scenario
in
c-sharp
7,
but
could
definitely
be
refined,
is
is
pattern
matching,
so
we
introduced
patterns
in
c-sharp,
7,
but
they're
more
things.
You
could
definitely
do
with
them.
Patterns
patterns
today
can
either
be
used
in
an
is
expression
or
they
can
be
used
in
an
good
old
fashion
switch
statement.
Well,
a
switch
statement
is
great.
It
lets
you
go
through
all
the
options,
one
by
one
but
syntactically
it's
a
bit
of
a
bear.
A
It's
like
50-year
old
syntax
from
from
C
that
has
been
carefully
carried
over
from
language
to
language,
and
so
it's
kind
of
clunky
and
one
of
the
things
we
want
to
do
is
introduce
a
switch
expression.
That's
just
sort
of
like
the
zipi
version
of
that
that
doesn't
have
all
that
as
syntactic
goo-
and
this
is
this-
is
roughly
what
it's
going
to
look
like.
A
So
I'm,
going
to
the
expression
form
switch,
is
an
infix
operator
between
Oh
the
object
that
I'm
going
to
switch
on
and
then
a
bunch
of
cases
here
which
don't
have
the
case
keyword
because
that's
fluff.
They
just
have
a
pattern
followed
by
a
and
lambda
arrow,
followed
by
the
expression,
for
what
is
that
was
what
are
we
going
to
produce
out
of
the
whole
expression
if
this
pattern
matches,
so
we
just
go
through
an
order
like
in
a
switch
statement.
Is
it
an
int,
then
call
it
AI
and
return
this
string
here?
A
Is
it
a
point,
then
here
is
another
thing
that
we
want
to
improve
with
with
patterns
which
is
recursive
patterns.
If
it's
a
point,
then
deconstruct
a
point
according
to
its
D
constructor,
which
again
a
feature
we
add
in
C
chef,
Sevan
and
then
apply
these
nested
patterns
recursively
to
the
values
that
came
out
of
deconstructing.
That
point,
so
a
point
comes
in
we
deconstruct
it.
We
get
two
values.
If
they're
both
intz,
then
they
satisfy
this
pattern
and
then
call
them
x
and
y
and
x
and
y.
A
I
can
then
be
used
in
the
expression
that
produces
a
result
of
the
pattern
and
so
on
and
of
course,
there's
a
discard
that
you
can
also
use,
and
that
means
you
don't
need
the
default
keyword
in
here
either.
So
that's
one
thing,
or
rather
two
things:
the
match:
expressions
or
switch
expressions
and
the
recursive
patterns
there
and
then
all
a
sort
of
special
version
of
the
recursive
pattern.
That
I
think
is
going
to
be
quite
useful.
A
I,
don't
know
why
I
have
the
match,
keyword
there,
that's
a
slight
copy-paste
fail,
but
switching
on
tuples
and
being
able
to
match
with
with
tuple
patterns
here
as
well.
So
that
takes
us
pretty
much
to
the
end.
There's
the
c-sharp
lang,
repo
is
where
all
the
language
design
discussion
happens.
We
can
go
and
take
a
quick
look
at
it
in
a
minute.
A
A
Still,
tinkering
with,
but
also
participate
in
the
lamp
design,
discussion
and
so
on,
and
the
docks
that
I
mentioned
before
docks
are
Microsoft
had
come,
has
brilliant
ducks
for
c-sharp
that
follow
along
the
new
versions
very
quickly
in
particular,
if
you
go
to
the
what's
new
on
the
C
sharp
you
get
the
latest
versions
and
all
the
features
that
are
in
there
so
I
want
to
just
quickly
before
we
take
it
over
to
QA.
Just
show
you
that
github
site
the
c-sharp
lang
site
here.
So
this
is
where
language
design
happens.
A
The
documents
that
we
use
for
designing
c-sharp
are
all
kept
here
in
the
open
where
everybody
can
see
them.
The
and
the
discussion
is
here
in
in
the
issues
where
everybody
can
participate.
So
you
can
see
the
source
code
in
this
repo
is
is
actually
documents.
Here
are
all
the
meeting
notes
from
all
the
c-sharp
language
design
meetings
dating
all
the
way
back
to
2013.
If
we
go
into
2018,
you
can
see,
there's
some
pretty
recent
ones
down
here.
A
A
And
here,
if
you
look
for
the
label
that
is
proposal
champion,
that
means
that
this
is
a
proposal
that
someone
on
the
language
design
team
thinks
that
we
should
look
into,
and
so
that's
a
really
good
label
to
filter
forward
to
see
what
is
currently
being
considered
by
the
c-sharp
language
design
team.
And
if
you
then
wonder
about
well,
what's
the
current
timeframe
for
considering
it,
you
can
go
and
further.
A
You
can
go
and
look
at
the
milestones
that
are
c-sharp
versions,
essentially
so,
for
instance,
the
things
that
are
currently
considered
for
going
into
c-sharp,
8
c
sharp
8.
Oh
these
ones
here
and
not
all
of
them
are
going
to
happen
like
we
generally
have
a
lot
more
in
these
milestones
and
will
actually
end
up
shipping
and
that's
the
milestone
is
more
like
an
indicator
of.
Where
do
we
think
it's
a
good
time
to
have
the
discussion
and
and
make
a
decision?
And
then
the
decision
might
be
I.
A
We
actually
don't
want
to
do
this
or
we'll
do
it
later.
Then
we
change
the
milestone
and
so
on.
So
that's
just
to
that
community
aspect
of
c-sharp
language
design
and
giving
you
sort
of
inviting
you
in
here
for
the
many
of
you
that
have
never
gone
there
come
in
and
have
a
look.
You
don't
need
to
be
a
language
wonk
and
you
don't
need
to
participate
in
all
the
heated
discussions.
A
So
I'm
going
to
see
if
I
can
see
what's
up
on
the
screen
up
here
and
then
take
some
questions.
So
here's
one
are
there
any
new
c-sharp
capabilities,
especially
useful
for
data
science?
That's
a
really
good
one.
This
data
science
in
general
machine
learning
in
particular,
which
you
know
some
would
say,
is
this
particular
branch
of
data
science.
A
That's
something
that
we
have
generally
not
been
good
at
in
c-sharp
and
in
dotnet,
and
we're
rapidly
getting
better
you
if
you,
if
you
heard
the
keynote
you
heard
about
ml
net,
where
we're
going
very
actively
after
having
great
machine
learning
frameworks
in
net,
and
so
how
does
she,
sharks,
c-sharp
stack
up
here?
Well,
it
has
a
few
things
from
old.
It
has
operator
overloading,
for
instance,
but
in
general
it's
not
very
good,
and
so
there
are
definitely
things
that
we're
looking
at
doing.
A
There's
also
things
that
we're
considering,
but
that
are
particularly
difficult
because
they
will
need
significant
runtime
changes
as
well.
One
of
the
things
that's
hard
in
almost
in
almost
all
programming
languages
is
a
good
type
safe
way
to
abstract.
Over
numerics
I
want
to
write
in
a
generic
algorithm
that
works
for
everything
that
has
a
plus
and
a
zero
static
property,
for
instance
like
how
can
you?
How
can
you
write
a
generic
constraint
that
says
something
that
has
a
plus
and
and
a
zero
property,
a
static,
zero
property?
A
Also,
we
can
always
improve
computation,
speed,
looking
at
targeting
GPUs
and
so
on,
and
that's
all
work
that
we're
we're
looking
at
and
hopefully
you
will
see
us
move
on
over
the
next
couple
years
in
a
big
way.
Okay
Igor
asks.
Will
we
ever
get
a
bit
more
verbose
null
reference
exception
that
will
include
information
about
what
variable
was
actually
null?
A
Well,
if
you,
if
you
use
the
debugger
in
Visual
Studio,
it
will
tell
you
exactly
what
variable
was
null,
so
we
we
did
that
as
a
as
an
IDE
feature
that
you
know
will
will
tell
you
right
things
as
long
as
you
were
inside
of
the
framework
of
Visual
Studio
now,
couldn't
we
do
this
at
runtime?
Even
when
you
get
those
runtime,
there
was
no
reference
exceptions
in
production.
A
Well,
that's
much
harder
because
now
we're
talking
about
information,
that's
not
actually
stored
anywhere
and
we
would
have
to
like
store
a
lot
of
extra
information
in
those
lean
mean
production
and
assemblies
in
order
to
get
that
so
I
don't
know
that
we'll
get
that,
but
as
long
as
you
do
it
in
the
debugger
in
Visual
Studio,
you
got
that.
Okay.
A
What
can
you
tell
us
about
the
async
streams
feature?
Also
so
I
pretty
much
told
you
what
I
cared?
How
does
it
relate
to
the
reactive
streams
work
being
done
in
the
community?
So
that's
a
really
good
question.
So
for
those
people
who
aren't
familiar
with
reactive
streams,
the
idea
of
reactive,
well
yeah
the
idea
of
an
unknowable
or
am
ia
sink
enumerable.
Is
there
pull
collections?
You
get
a
new
element
when
you
ask
for
it,
so
you
pull
four
elements.
Okay,
reactive
is
the
push
kind
of
framework
where
you
give
it.
A
Essentially
you
give
your
collection
a
call
back,
and
it
will
call
the
call
back
back
whenever
there's
a
new
element.
So
it's
pushing
information
to
the
call
back
and
that's
sort
of
two
opposites
and
they
they.
It
affects
the
direction
that
you
compose
them
in.
If
you
will
so
so,
Paul
has
the
problem
that
consumption
needs
to
happen
at
the
you
know
at
the
speed
of
the
consumer.
A
So
somehow
the
producer
needs
to
make
values
available
when
you're
ready
for
that
async
is
better
because
it's
a
little
better
there,
because
you,
the
consumer,
is
at
least
willing
to
wait
around
until
the
value
is
there.
Synchronously
push
has
the
opposite
problem
that
it
happens
at
the
speed
of
the
producer
and
the
the
stream
of
values
might
easily
choke
consumer
is
that
they
just
can't
process
the
values
coming
at
them
fast
enough,
and
so
you
can
make.
You
could
also
in
parallel,
have
an
async
reactive
framework
that
would
kind
of
hold
back
the
producer.
A
A
So
that's
that's
where
you
would
see
hat
0
being
used
and
that's
one
of
the
reasons
why
we
didn't
go
with
or
something
like
that,
because
then
you'd
want
to
be
able
to
distinguish
0
and
minus
0,
and
those
are
really
hard
to
distinguish.
That's
pretty
much
it
for
time.
I
think,
and
there
are
no
more
questions
up
there.
A
So
with
that
I
want
to
say
thank
you
very
much
for
listening
in
either
live
or
at
the
leisure
of
your
own
time
and
go
play
with
the
the
latest.
C
sharp
features
keep
an
eye
out
for
C
sharp
8
and
try
the
previews
as
soon
as
they
come
out
and
tell
us
what
you
think
tell
us
online
because
we're
there
and
we're
eager
to
hear
and
heed
your
feedback.
Thank
you
very
much.