SlideShare a Scribd company logo
1 of 22
Download to read offline
Typed JavaScript
with TypeScript
Oliver Zeigermann
What is TypeScript?
•  Programming Language

•  Superset of JavaScript

•  Compiles to JavaScript

•  Adds Declared Types

•  Every valid JavaScript

•  Reduces boiler plate code

program also is a valid

•  Developed by Microsoft

TypeScript program

•  Head: Anders Hejlsberg
|

zeigermann.eu
TypeScript

http://www.typescriptlang.org
|

zeigermann.eu
Types
|

zeigermann.eu
Declared static types
•  TypeScript offers optional static typing
•  Type Inference can infer types even when you
do not declare them
•  Declared Types enable reliable IDE support

|

zeigermann.eu
Reliable IDE support for
•  Code Analysis

•  Refactoring

•  Code Completion

•  Type Hierarchies

•  Quick Fixes

•  Outline

|

zeigermann.eu
JavaScript IDEs offer that
without declared types, but…
not reliable!
•  Ever had a non-reliable Internet Connection?
•  Remember how that felt?
•  You want refactoring and code analysis to be reliable
|

zeigermann.eu
Optional Declared Types: Basics
var name = "Olli";

function doIt(p1, p2, p3) {
…
}
doIt(name);

|

zeigermann.eu
Optional Declared Types: Basics
var name: string = "Olli";

function doIt(p1: number, p2: boolean, p3: string): void {
…
}
doIt(name);

|

zeigermann.eu
IDE Support
•  Best IDEs
•  WebStorm / IntelliJ IDEA Ultimate
•  Visual Studio (Express only with limited support)

•  Full refactoring / Code completion etc.
•  Not quite at the level of Java-IDEs, yet
|

zeigermann.eu
Syntactic
Sugar
|

zeigermann.eu
JavaScript can express all this
•  classes

•  modules

•  interfaces

•  optional and default
parameters

•  inheritance

•  and more…

|

zeigermann.eu
JavaScript for Inheritance
__extends(Horse, Animal);
function Horse(name) {
Animal.call(this, name);
}
Horse.prototype.move = function () {
alert("Galloping...");
Animal.prototype.move.call(this, 45);
};

|

zeigermann.eu
Boiler Plate Code sucks
•  TypeScript offers syntactic sugar for those patterns
•  No other modifications to language
•  Compiler spits out best practice code

|

zeigermann.eu
TypeScript for Inheritance
class Horse extends Animal {
constructor(name: string) { super(name); }
move(): void {
alert("Galloping...");
super.move(45);
}
}

|

zeigermann.eu
Compare
|

zeigermann.eu
Comparing to CoffeeScript
CoffeeScript has in

CoffeeScript differs

common

•  Semantics (a little) different

•  Compiles to JavaScript

from JavaScript
•  No static type information

•  Classes and inheritance
as syntactic sugar

•  Fixes lexical scoping
|

zeigermann.eu
Comparing to Dart
Dart has in common

Dart differs

•  Optional static typing

•  Semantics different from
JavaScript

including Generics

•  Runs on Client and Server •  Can also be executed
natively in dedicated VM

•  Compiles to JavaScript
|

zeigermann.eu
Wrap-Up
•  Optional Declared Types enable premium IDE support
•  Syntactic sugar reduces boiler plate code
•  Still totally compatible with JavaScript
•  Added features aligned with ECMAScript Harmony
•  Dart and CoffeeScript both differ in Philosophy
|

zeigermann.eu
Where to apply?
•  Business Logic: totally
•  UI Logic only partially benefits from types
when accessed from template
•  Mixture of typed and untyped not an issue
•  Backend and frontend both cool
|

zeigermann.eu
And there is more!
•  Mapping files

•  Generics

•  External module

•  Casts

declarations for AMD /

•  All the ES 6 goodness

CommonJS

•  Declaration files for

•  Enums

JavaScript libraries
|

zeigermann.eu
Thanks for the attention!
Questions / Discussion!
!
!
Follow @DJCordhose
oliver@zeigermann.de
zeigermann.eu

More Related Content

What's hot

OpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developersOpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developersBert Jan Schrijver
 
Code Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developersCode Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developersBert Jan Schrijver
 
J-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developersJ-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developersBert Jan Schrijver
 
Lambda local - A local server for developing AWS Lambda function in Java
Lambda local - A local server for developing AWS Lambda function in JavaLambda local - A local server for developing AWS Lambda function in Java
Lambda local - A local server for developing AWS Lambda function in JavaYenwen Feng
 
Tweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developersTweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developersBert Jan Schrijver
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivationjistr
 
Ansible, Idempotency, and Jenkins
Ansible, Idempotency, and JenkinsAnsible, Idempotency, and Jenkins
Ansible, Idempotency, and Jenkinstylerturk
 
BDD API Tests with Gherkin and Behat
BDD API Tests with Gherkin and BehatBDD API Tests with Gherkin and Behat
BDD API Tests with Gherkin and BehatMark Niebergall
 
Shortening the feedback loop: faster and better code development
Shortening the feedback loop: faster and better code developmentShortening the feedback loop: faster and better code development
Shortening the feedback loop: faster and better code developmentSigasi
 
EclipseCon Europe 2011
EclipseCon Europe 2011EclipseCon Europe 2011
EclipseCon Europe 2011Sigasi
 
Learn Elixir at Manchester Lambda Lounge
Learn Elixir at Manchester Lambda LoungeLearn Elixir at Manchester Lambda Lounge
Learn Elixir at Manchester Lambda LoungeChi-chi Ekweozor
 
Introduction to Scala for Java Developers
Introduction to Scala for Java DevelopersIntroduction to Scala for Java Developers
Introduction to Scala for Java DevelopersSolix JJ
 
Test automation with cucumber jvm
Test automation with cucumber jvmTest automation with cucumber jvm
Test automation with cucumber jvmNibu Baby
 
Getting started with scala cats
Getting started with scala catsGetting started with scala cats
Getting started with scala catsKnoldus Inc.
 
5 hs mpostcustomizationrenefonseca
5 hs mpostcustomizationrenefonseca5 hs mpostcustomizationrenefonseca
5 hs mpostcustomizationrenefonsecassuserfadb24
 
Ntd2015_pt_kanban_ppt
Ntd2015_pt_kanban_pptNtd2015_pt_kanban_ppt
Ntd2015_pt_kanban_pptJokin Aspiazu
 

What's hot (20)

OpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developersOpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developers
 
Code Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developersCode Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developers
 
J-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developersJ-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developers
 
Variables in Pharo5
Variables in Pharo5Variables in Pharo5
Variables in Pharo5
 
Lambda local - A local server for developing AWS Lambda function in Java
Lambda local - A local server for developing AWS Lambda function in JavaLambda local - A local server for developing AWS Lambda function in Java
Lambda local - A local server for developing AWS Lambda function in Java
 
Tweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developersTweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developers
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivation
 
Ansible, Idempotency, and Jenkins
Ansible, Idempotency, and JenkinsAnsible, Idempotency, and Jenkins
Ansible, Idempotency, and Jenkins
 
BDD API Tests with Gherkin and Behat
BDD API Tests with Gherkin and BehatBDD API Tests with Gherkin and Behat
BDD API Tests with Gherkin and Behat
 
Shortening the feedback loop: faster and better code development
Shortening the feedback loop: faster and better code developmentShortening the feedback loop: faster and better code development
Shortening the feedback loop: faster and better code development
 
EclipseCon Europe 2011
EclipseCon Europe 2011EclipseCon Europe 2011
EclipseCon Europe 2011
 
Vimperl
VimperlVimperl
Vimperl
 
Learn Elixir at Manchester Lambda Lounge
Learn Elixir at Manchester Lambda LoungeLearn Elixir at Manchester Lambda Lounge
Learn Elixir at Manchester Lambda Lounge
 
Why puppet? Why now?
Why puppet? Why now?Why puppet? Why now?
Why puppet? Why now?
 
Introduction to Scala for Java Developers
Introduction to Scala for Java DevelopersIntroduction to Scala for Java Developers
Introduction to Scala for Java Developers
 
Test automation with cucumber jvm
Test automation with cucumber jvmTest automation with cucumber jvm
Test automation with cucumber jvm
 
Getting started with scala cats
Getting started with scala catsGetting started with scala cats
Getting started with scala cats
 
5 hs mpostcustomizationrenefonseca
5 hs mpostcustomizationrenefonseca5 hs mpostcustomizationrenefonseca
5 hs mpostcustomizationrenefonseca
 
Using TypeScript with Angular
Using TypeScript with AngularUsing TypeScript with Angular
Using TypeScript with Angular
 
Ntd2015_pt_kanban_ppt
Ntd2015_pt_kanban_pptNtd2015_pt_kanban_ppt
Ntd2015_pt_kanban_ppt
 

Similar to TypeScript: Typed JavaScript with Optional Declared Types

Typescript Fundamentals
Typescript FundamentalsTypescript Fundamentals
Typescript FundamentalsSunny Sharma
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET Dmytro Mindra
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better appsColdFusionConference
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better appsdevObjective
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code ReviewMilan Vukoje
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler ConstructionAhmed Raza
 
TypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideTypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideNascenia IT
 
All My Tests Are Passing, Now What?
All My Tests Are Passing, Now What?All My Tests Are Passing, Now What?
All My Tests Are Passing, Now What?Christopher Read
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesInductive Automation
 
Hidden Treasure - TestComplete Script Extensions
Hidden Treasure - TestComplete Script ExtensionsHidden Treasure - TestComplete Script Extensions
Hidden Treasure - TestComplete Script ExtensionsSmartBear
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesInductive Automation
 
Write Generic Code with the Tooling API
Write Generic Code with the Tooling APIWrite Generic Code with the Tooling API
Write Generic Code with the Tooling APIAdam Olshansky
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)Igor Talevski
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGil Fink
 
compiler and their types
compiler and their typescompiler and their types
compiler and their typespatchamounika7
 
Making Scala Faster: 3 Expert Tips For Busy Development Teams
Making Scala Faster: 3 Expert Tips For Busy Development TeamsMaking Scala Faster: 3 Expert Tips For Busy Development Teams
Making Scala Faster: 3 Expert Tips For Busy Development TeamsLightbend
 
.Net programming with C#
.Net programming with C#.Net programming with C#
.Net programming with C#NguynSang29
 

Similar to TypeScript: Typed JavaScript with Optional Declared Types (20)

Typescript Fundamentals
Typescript FundamentalsTypescript Fundamentals
Typescript Fundamentals
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better apps
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better apps
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code Review
 
TypeScript
TypeScriptTypeScript
TypeScript
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler Construction
 
TypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideTypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation Guide
 
All My Tests Are Passing, Now What?
All My Tests Are Passing, Now What?All My Tests Are Passing, Now What?
All My Tests Are Passing, Now What?
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
 
Hidden Treasure - TestComplete Script Extensions
Hidden Treasure - TestComplete Script ExtensionsHidden Treasure - TestComplete Script Extensions
Hidden Treasure - TestComplete Script Extensions
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
 
Write Generic Code with the Tooling API
Write Generic Code with the Tooling APIWrite Generic Code with the Tooling API
Write Generic Code with the Tooling API
 
Babel.pptx
Babel.pptxBabel.pptx
Babel.pptx
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript Language
 
C# basics...
C# basics...C# basics...
C# basics...
 
compiler and their types
compiler and their typescompiler and their types
compiler and their types
 
Making Scala Faster: 3 Expert Tips For Busy Development Teams
Making Scala Faster: 3 Expert Tips For Busy Development TeamsMaking Scala Faster: 3 Expert Tips For Busy Development Teams
Making Scala Faster: 3 Expert Tips For Busy Development Teams
 
.Net programming with C#
.Net programming with C#.Net programming with C#
.Net programming with C#
 

Recently uploaded

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

TypeScript: Typed JavaScript with Optional Declared Types

  • 2. What is TypeScript? •  Programming Language •  Superset of JavaScript •  Compiles to JavaScript •  Adds Declared Types •  Every valid JavaScript •  Reduces boiler plate code program also is a valid •  Developed by Microsoft TypeScript program •  Head: Anders Hejlsberg | zeigermann.eu
  • 5. Declared static types •  TypeScript offers optional static typing •  Type Inference can infer types even when you do not declare them •  Declared Types enable reliable IDE support | zeigermann.eu
  • 6. Reliable IDE support for •  Code Analysis •  Refactoring •  Code Completion •  Type Hierarchies •  Quick Fixes •  Outline | zeigermann.eu
  • 7. JavaScript IDEs offer that without declared types, but… not reliable! •  Ever had a non-reliable Internet Connection? •  Remember how that felt? •  You want refactoring and code analysis to be reliable | zeigermann.eu
  • 8. Optional Declared Types: Basics var name = "Olli"; function doIt(p1, p2, p3) { … } doIt(name); | zeigermann.eu
  • 9. Optional Declared Types: Basics var name: string = "Olli"; function doIt(p1: number, p2: boolean, p3: string): void { … } doIt(name); | zeigermann.eu
  • 10. IDE Support •  Best IDEs •  WebStorm / IntelliJ IDEA Ultimate •  Visual Studio (Express only with limited support) •  Full refactoring / Code completion etc. •  Not quite at the level of Java-IDEs, yet | zeigermann.eu
  • 12. JavaScript can express all this •  classes •  modules •  interfaces •  optional and default parameters •  inheritance •  and more… | zeigermann.eu
  • 13. JavaScript for Inheritance __extends(Horse, Animal); function Horse(name) { Animal.call(this, name); } Horse.prototype.move = function () { alert("Galloping..."); Animal.prototype.move.call(this, 45); }; | zeigermann.eu
  • 14. Boiler Plate Code sucks •  TypeScript offers syntactic sugar for those patterns •  No other modifications to language •  Compiler spits out best practice code | zeigermann.eu
  • 15. TypeScript for Inheritance class Horse extends Animal { constructor(name: string) { super(name); } move(): void { alert("Galloping..."); super.move(45); } } | zeigermann.eu
  • 17. Comparing to CoffeeScript CoffeeScript has in CoffeeScript differs common •  Semantics (a little) different •  Compiles to JavaScript from JavaScript •  No static type information •  Classes and inheritance as syntactic sugar •  Fixes lexical scoping | zeigermann.eu
  • 18. Comparing to Dart Dart has in common Dart differs •  Optional static typing •  Semantics different from JavaScript including Generics •  Runs on Client and Server •  Can also be executed natively in dedicated VM •  Compiles to JavaScript | zeigermann.eu
  • 19. Wrap-Up •  Optional Declared Types enable premium IDE support •  Syntactic sugar reduces boiler plate code •  Still totally compatible with JavaScript •  Added features aligned with ECMAScript Harmony •  Dart and CoffeeScript both differ in Philosophy | zeigermann.eu
  • 20. Where to apply? •  Business Logic: totally •  UI Logic only partially benefits from types when accessed from template •  Mixture of typed and untyped not an issue •  Backend and frontend both cool | zeigermann.eu
  • 21. And there is more! •  Mapping files •  Generics •  External module •  Casts declarations for AMD / •  All the ES 6 goodness CommonJS •  Declaration files for •  Enums JavaScript libraries | zeigermann.eu
  • 22. Thanks for the attention! Questions / Discussion! ! ! Follow @DJCordhose oliver@zeigermann.de zeigermann.eu