SlideShare une entreprise Scribd logo
1  sur  23
Andrea Boschin
http://1drv.ms/1flJCDT
Typescript overview
Javascript
why?
Javascript
any browser
any host
any os
Javascript
hard to learn
hard to read
hard to maintain
Javascript
type unsafe
prone to tricks
non-scoped
Typescript
starts with Javascript, ends with Javascript
è un superset tipizzato di Javascript quindi
il codice Javascript è già Typescript
(on steroids)
Typescript
starts with Javascript, ends with Javascript
produce Javascript quindi
any browser, any host, any os!
Typescript
static type checking
var a: string = 'Andrea';
var b: number = 10;
var c: number = a + b;
Cannot convert ‘string’ to
‘number’
Typescript
structural typing
var speaker: { firstName: string; lastName: string; };
speaker =
{
firstName: 'Andrea',
lastName: 'Boschin'
};
Declares a type inline
Typescript
interfaces
interface IPerson
{
firstName: string;
lastName: string;
birthDate: Date;
}
var developer: IPerson =
{
firstName: 'Andrea',
lastName: 'Boschin',
birthDate: new Date(1968, 10, 27)
};
Declares an interface
Javascript
Interface output
var developer = {
firstName: 'Andrea',
lastName: 'Boschin',
birthDate: new Date(1968, 10, 27)
};
Typescript
classes
class Person
{
firstName: string;
lastName: string;
birthDate: Date;
getAge(): number
{
return new Date().getFullYear() - this.birthDate.getFullYear();
}
}
var speaker: Person = new Person();
speaker.firstName = 'Andrea';
speaker.lastName = 'Boschin';
speaker.birthDate = new Date(1968, 10, 27);
console.log(speaker.getAge());
Javascript
class output
var Person = (function () {
function Person() {
}
Person.prototype.getAge = function () {
return new Date().getFullYear() - this.birthDate.getFullYear();
};
return Person;
})();
var speaker = new Person();
speaker.firstName = 'Andrea';
speaker.lastName = 'Boschin';
speaker.birthDate = new Date(1968, 10, 27);
console.log(speaker.getAge());
Typescript
modules
module model
{
export class Person
{ /* person implementation */ }
export module collections
{
export class PersonList
{ /* collection implementation */ }
}
}
var me: model.Person
= new model.Person();
var people: model.collections.PersonList
= new model.collections.PersonList();
Typescript
callbacks
class Service
{
public getItems(success: (result: any[]) => void): void
{
success(["a", "b", "c"]);
}
} function(result: any[]): void {}
Typescript
external libs
definition files
https://github.com/borisyankov/DefinitelyTyped
jquery
angular
knockout
.d.ts
.d.ts
.d.ts
Typescript
memo
VS debugger works! (thanks to «sourcemaps»)
Typescript compiler is developed with Typescript
Compiler can be hosted in ECMASCRIPT 3 browsers
Typescript
why
 support for ECMAScript 6 in ECMAScript 3 browsers
 open Source and available to download on codeplex
 tooling support, for type safety, inference and refactoring
 static types and compilation catches mistakes earlier
 structural interfaces & typing
 works well with existing projects
Anders Hejlsberg is involved.
enables programming in the large
Typescript
toolset
http://www.typescriptlang.org
visual studio 2012/2013
plugin available
visual studio 2013 - update 2 - Feb 25
integrated
other IDE?
Sublime Text, EMACS, Vim
LAB
feedback
10
o feedback su:
• http://xedotnet.org/feedback
• MAIL
andrea@boschin.it
• TWITTER
http://twitter.com/aboschin
• FACEBOOK
http://www.facebook.com/thesmallgrove
ANDREA BOSCHIN
Most Valuable Professional
Prossimo Meeting
11 aprile 2014 – Virtual Meeting
21:00 – Pragmatic Javascript
Speaker: D.Morosinotto
Un viaggio nel "mondo Javascript": partendo dalle basi (tipi di
dati, oggetti literal, array associativi, prototype e this...) vedremo
come sia possibile implementare dei Pattern OOP (Closure,
Revealing Modulo, Mixin...) Forse scopriremo che JS può fare
qualcosa di più che gestire qualche click e modificare degli
elementi del DOM con JQuery, a voi l'ardua sentenza...
Prossimo Meeting
4 aprile 2014 – Community Meeting: Visual
Studio20:00 - Sviluppare applicazioni web (completamente) on-line con Visual Studio
«Monaco»
Speaker: M.Parenzan
Windows Azure e Team Foundation Server hanno cominciato a cambiare in una
maniera incredibile il modo di gestire i progetti software e tutta l'attività professionale
dello sviluppatore. Ora il passaggio ulteriore: un Visual Studio che gira nel browser...
21:30 - Utilizzare Git con TFS
Speaker: D.Vernole
In questa sessione vedremo come sia possibile utilizzare GIT come repository dei
sorgenti in TFS 2013 in alternativa a Visual Source Control

Contenu connexe

Similaire à Typescript overview

JavaScript & Enterprise BED-Con 2014 Berlin German
JavaScript & Enterprise BED-Con 2014 Berlin GermanJavaScript & Enterprise BED-Con 2014 Berlin German
JavaScript & Enterprise BED-Con 2014 Berlin German
Adam Boczek
 
The Future of Web Attacks - CONFidence 2010
The Future of Web Attacks - CONFidence 2010The Future of Web Attacks - CONFidence 2010
The Future of Web Attacks - CONFidence 2010
Mario Heiderich
 
Jassa la GeekMeet Bucuresti
Jassa la GeekMeet BucurestiJassa la GeekMeet Bucuresti
Jassa la GeekMeet Bucuresti
alexnovac
 
NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MBNodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
David Wesst
 

Similaire à Typescript overview (20)

TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret Weapon
 
Migrating Web SDK from JS to TS
Migrating Web SDK from JS to TSMigrating Web SDK from JS to TS
Migrating Web SDK from JS to TS
 
Introduction to Angular for .NET Developers
Introduction to Angular for .NET DevelopersIntroduction to Angular for .NET Developers
Introduction to Angular for .NET Developers
 
Introduction to Angular for .NET Developers
Introduction to Angular for .NET DevelopersIntroduction to Angular for .NET Developers
Introduction to Angular for .NET Developers
 
JavaScript & Enterprise BED-Con 2014 Berlin German
JavaScript & Enterprise BED-Con 2014 Berlin GermanJavaScript & Enterprise BED-Con 2014 Berlin German
JavaScript & Enterprise BED-Con 2014 Berlin German
 
The First C# Project Analyzed
The First C# Project AnalyzedThe First C# Project Analyzed
The First C# Project Analyzed
 
The Future of Web Attacks - CONFidence 2010
The Future of Web Attacks - CONFidence 2010The Future of Web Attacks - CONFidence 2010
The Future of Web Attacks - CONFidence 2010
 
Introduction to Angular with TypeScript for .NET Developers
Introduction to Angular with TypeScript for .NET DevelopersIntroduction to Angular with TypeScript for .NET Developers
Introduction to Angular with TypeScript for .NET Developers
 
Introduction to Angular for .NET Developers
Introduction to Angular for .NET DevelopersIntroduction to Angular for .NET Developers
Introduction to Angular for .NET Developers
 
Jassa la GeekMeet Bucuresti
Jassa la GeekMeet BucurestiJassa la GeekMeet Bucuresti
Jassa la GeekMeet Bucuresti
 
C#.net
C#.netC#.net
C#.net
 
introduction to html
introduction to htmlintroduction to html
introduction to html
 
NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MBNodeJS for Novices - 28/Oct/13 - Winnipeg, MB
NodeJS for Novices - 28/Oct/13 - Winnipeg, MB
 
Javascript Security
Javascript SecurityJavascript Security
Javascript Security
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
 
(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe
 
The Roslyn Compiler: Look at Your Code from a Different Perspective (Raffaele...
The Roslyn Compiler: Look at Your Code from a Different Perspective (Raffaele...The Roslyn Compiler: Look at Your Code from a Different Perspective (Raffaele...
The Roslyn Compiler: Look at Your Code from a Different Perspective (Raffaele...
 
Cisco Spark the Industry Challenge
Cisco Spark the Industry ChallengeCisco Spark the Industry Challenge
Cisco Spark the Industry Challenge
 
2 Roads to Redemption - Thoughts on XSS and SQLIA
2 Roads to Redemption - Thoughts on XSS and SQLIA2 Roads to Redemption - Thoughts on XSS and SQLIA
2 Roads to Redemption - Thoughts on XSS and SQLIA
 
Ustream vs Legacy, It's never too late to start your fight! #Jsist 2014
Ustream vs Legacy, It's never too late to start your fight! #Jsist 2014Ustream vs Legacy, It's never too late to start your fight! #Jsist 2014
Ustream vs Legacy, It's never too late to start your fight! #Jsist 2014
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Typescript overview

Notes de l'éditeur

  1. type unsafeIl linguaggio non ha un controllo statico dei tipi L’errore è sempre dietro l’angoloprone to tricksLa sua natura rende spesso necessari trucchi che lo rendono illeggibilenon-scopedPer quanto molti lo credano: non è un linguaggio ad oggettiNon esite «scoping»
  2. type unsafeIl linguaggio non ha un controllo statico dei tipi L’errore è sempre dietro l’angoloprone to tricksLa sua natura rende spesso necessari trucchi che lo rendono illeggibilenon-scopedPer quanto molti lo credano: non è un linguaggio ad oggettiNon esite «scoping»
  3. type unsafeIl linguaggio non ha un controllo statico dei tipi L’errore è sempre dietro l’angoloprone to tricksLa sua natura rende spesso necessari trucchi che lo rendono illeggibilenon-scopedPer quanto molti lo credano: non è un linguaggio ad oggettiNon esite «scoping»