[MUSIC]
>> I have such a cool interview.
Ready?
TypeScript has helped build
JavaScript projects at tiny scale
and huge scale all over the world.
Here to share the latest is
Program Manager on the team, Daniel Rosenwasser.
Hello, Daniel,
thank you so much for joining us here at Build.
>> Thanks for having me.
It's a pleasure.
>> It is a pleasure to have you join us actually
and our shenanigans,
we've barely broken things.
Just letting you know.
For our audience, do you mind telling everyone
who you are and what you do?
>> Well, as you know,
I'm Daniel Rosenwasser as you just heard.
I am the Program Manager on
the TypeScript team here at Microsoft,
where I work on anything
between TypeScript, with the language itself,
I contribute to ECMAScript,
the spec for JavaScript.
I also help contribute to the editor support
that you all know and love for TypeScript
and JavaScript in the Visual Studio family of products,
so VS, VS Code, etc.
>> I think TypeScript is such an inclusive language.
It might actually be the most inclusive language,
which kills me a little bit because C++ people.
But I come from an object-oriented background
and I love it.
So many people don't come from
an object-oriented background, but also love it.
Usually, languages are holy war,
either you're object-oriented people
or you're not object-oriented people.
But TypeScript is something that everyone loves.
Can you please share a little bit about why that is
and how TypeScript came to be this?
>> It's a really good question, actually.
I think that TypeScript has to come at
a language design that needs to bridge the gap.
One of those holy wars that you see in programming and
programming languages is dynamic versus static languages,
and TypeScript has to bridge those together.
But likewise, JavaScript is already
a language that does accommodate,
whether you're functional or object-oriented.
To model a typed version of JavaScript,
you need to model all of that.
So when we first started out,
we actually came in and brought
what we knew in the OO space, object-oriented space.
Then more and more,
we learned about different patterns and paradigms
because we were writing
TypeScript and JavaScript ourselves,
and understood it better and learned it.
We really took what our users said to heart
and tried to address them and their concerns,
and met the community where they were.
>> That is awesome.
Right now, we're here at Build and you know Build is
a time you always announce the coolest things.
What is new for our audience
right now in TypeScript plans?
>> Just a couple hours ago,
we just released TypeScript 4.3.
I'm extremely excited about that.
A lot of great new features,
optimizations,
awesome editing functionality that's come down the line.
But one of the really cool things
that I want to talk about is something called
the override keyword
and a stricter check for the override keyword
that I'd like to just dive into if we can go into a demo.
>> Oh, please. By the way,
I requested the override keyword,
so I want to see this, definitely.
>> Awesome.
Let's say you have a base class
and derived class of some sort.
Now, you might have a method in
the derived class that overrides
the one in the base class.
But there's a bit of a snag there.
You're making this implicit contract because,
let's say you decided to
rename something in the base class.
If anyone now tries to call this doSomething method,
they're basically not going to get the derived one.
Now you end up with a useless method in
the derived class that no one's using, accidentally.
What we did is we added a new keyword called override.
Now, what you can actually do is
you can prefix the derived method
with your override keyword and say,
"This is intended to
override something in the base class.
If it's not, I want to get an error."
Now, you will actually get an error here
and you'll know that, "Hey,
I need to actually correct the spelling of this
because someone in the base renamed something
but didn't bother to rename it up here."
There's that problem.
But then there's a dual problem of, well,
let's say I have a method in the derived class,
but someone adds one in the base class,
and it has the same name.
Well, the way the Javas works is that
you accidentally could clobber the one in the base class,
and now you might not even know
about it until sometime
later at runtime, maybe in production.
We add it as a new flag to help catch that case
where you need to explicitly add
an override keyword in those cases.
If you ever override a method in a derived class,
you need to add that keyword
and otherwise, it's an error.
That flag is now called no implicit override.
As you just saw, we were able to get a quick fix in there
and just add it in there once we got the error message.
That's the magic that we're trying to add to
our editors just to beef up language parity.
>> I love that. I think that it's fantastic
and so many people are going to use those.
I want to give a huge shout-out to my friend
Cassie Breviu on our team,
who actually pointed me to TypeScript.
When I was trying to learn a scripting language,
she said, "Just use TypeScript."
It's so familiar to you without having to
break out of the paradigms and the syntax,
and things you're used to.
So many people have been brought to TypeScript
because of its inclusivity and
because you co-create with the community,
and put in all of these requests.
You all drop features so casually, like weekly,
it feels like. Weekly. It's so cool. So cool.
>> I don't know.
I get giddy just thinking about it.
But yeah, I think one of the things there is that
we release every three months.
>> Really?
>> We don't expect everyone to just jump on it.
We encourage it,
but we don't want to make people feel pressured.
But we always have great new features.
One of the cool things coming down the pipeline
is TypeScript 4.4.
>> Oh, yeah.
>> Really cool things that are coming down there.
We have some new strictness flags
for optional properties and for trycaches.
We have some really cool stuff coming down the pipeline
for just better index signatures
if you're familiar with that.
But it's all public and you can go
check out our iteration plan on GitHub,
where we actually have public release dates
that we put out,
public features that you can get a look at.
But if you're just learning TypeScript,
I encourage you to check out
the TypeScript website,
which is typescriptlang.org.
Also, just follow the Twitter account too,
which is just @TypeScript on Twitter.
I think that that is a great way to start.
>> I love that.
Call to actions everyone,
typescriptlang.org.
Follow the @TypeScript Twitter handle.
Thank you so much for being here with us, Daniel.
>> Thank you.
>> Have a great Build.