The standard technique for avoiding globals
Sometimes global variables can be quite sneaky. Be on guard.
Some best practices to catch common mistakes
Globals bite us again, in the most unexpected spots
Avoiding accidental creation of globals
ES6 enhancements, but we can't use them until ES6.
List of reserved keywords - too many to avoid reliably. So how do we avoid them?
Even careless semi colons can lead to errors
TypeOf operator isn't very good
Who knew numbers could be so unreliable
Difference between null or undefined, but sometimes they can be the same!
DataTypes behave in unexpected ways with different operators
Use parseInt to be safe, but there be landmines here!
Not a number, is a number? Apparently!
Comparison operators should be simple, right?
More unexpected operator behavior
A very common mistake, except there is no compiler to help out!
When a number isn't what you thought it was!
Bitwise can bite !
More number weirdness
You can do without with
Arrays so simple, yet so complex
Functions can also be scopes.
Hoisting while helpful can lead to errors
Content delivery network failures are your failures
Its not secure
When this isn't what you thought it was
.. and there are more issues.
Over time there are coding conventions that are there for a reason. Stick with these because they are not only a standard, they will help you avoid silly mistakes
What is TypeScript, and why do we care?
How does TypeScript fit in with current web technologies?
The various important workflows and files involved.
The easy way to TypeScript, but not cross platform
Using Visual Studio code and Gulp to setup TypeScript
Save -> F5 -> Repeat, is a good workflow, but needs continous background compilation.
What good is a language you cannot debug? In this session we setup how to debug TypeScript.
No TypeScript yet, and you are already seeing benefits
Catching silly errors early - even if you don't type TypeScript (yet)
Strong typing is good
So many HTML elements, intellisense would be nice
Intellisense and help text teach me as I work
Intellisense becomes very important in larger projects.
Frequently we use third party libraries. It would be nice to get intellisense and help text for those third party libraries.
Using interfaces effectively to avoid errors.
Arrays can be a pain, but with TypeScript they are such a breeze to manage.
Stay classy, and provide decent constructors where you need to, with TypeScript of course.
More classy stuff with functions, just like you'd do in any other OO language.
Inheritance can be so complex but with TypeScript it is so intuitive.
What interfaces give you in TypeScript
Mixing matching merging interfaces.
Super keyword helps you access base class properties and methods, and how it works.
More encapsultion with accessors
How statics work in a class in TypeScript
Use classes or interfaces interchangeably, and where they are not interchangeable.
Modularize your code to make it more manageable.
More features from the future, this time around ES6 features for functions.
Even mMore features from the future, this time around arrow functions, with this keyword benefits for free.
Generics are very powerful. Learn how to use them effectively.
Sahil Malik is a developer and instructor who has been teaching developers for over 15 years and has worked in 17 countries and 5 continents. As an author of more than 20 books, recipient of the Microsoft MVP award for more than 10 years, and a consultant and trainer he knows how to make tough concepts easy to grasp and apply.