Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Warum TypeScript?
Search
Joshy Cyriac
September 18, 2015
Programming
0
150
Warum TypeScript?
Talk given at bed-con.org in Berlin 2015
Joshy Cyriac
September 18, 2015
Tweet
Share
Other Decks in Programming
See All in Programming
ビルドプロセスをデバッグしよう!
yt8492
0
310
「10分以内に機能を消せる状態」 の実現のためにやっていること
togishima
1
290
Phronetic Team with AI - Agile Japan 2025 closing
hiranabe
2
560
Promise.tryで実現する新しいエラーハンドリング New error handling with Promise try
bicstone
2
440
GraalVM Native Image トラブルシューティング機能の最新状況(2025年版)
ntt_dsol_java
0
120
アーキテクチャと考える迷子にならない開発者テスト
irof
7
2.7k
CSC509 Lecture 10
javiergs
PRO
0
170
問題の見方を変える「システム思考」超入門
panda_program
0
200
開発生産性が組織文化になるまでの軌跡
tonegawa07
0
150
AI 時代だからこそ抑えたい「価値のある」PHP ユニットテストを書く技術 #phpconfuk / phpcon-fukuoka-2025
shogogg
1
430
KoogではじめるAIエージェント開発
hiroaki404
1
480
CloudflareのSandbox SDKを試してみた
syumai
0
140
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Bash Introduction
62gerente
615
210k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Building Applications with DynamoDB
mza
96
6.8k
Practical Orchestrator
shlominoach
190
11k
The Pragmatic Product Professional
lauravandoore
36
7k
RailsConf 2023
tenderlove
30
1.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Building Adaptive Systems
keathley
44
2.8k
Six Lessons from altMBA
skipperchong
29
4.1k
Transcript
WARUM TYPESCRIPT? JOSHY CYRIAC @IRRWITZ FINEBRAIN.COM
UMFRAGE
ANFANG Java-Land JS-Land
TYPESCRIPT LÖSUNGEN FÜR 2 JS PROBLEME
PROBLEM EINS
module.exports = function extract(data, topic) { … } “article.js”
var article=require(‘article’); var item = require(‘item’); article.extract(data, ‘news’); item.extract(data, 12);
PROBLEM ZWEI
function extract( data, topic ) { … }
None
–from typescriptlang.org “Any browser. Any host. Any OS. Open Source.”
JS TS TS is a TYPED superset of JS
TS Files TS Compiler JS Files
PROBLEM EINS
module.exports = function extract(data, topic) { … } “article.js”
OPTIONAL TYPE SYSTEM
var answer: number = 4; var n: number[] = [1,
2, 3]; var city: string = “Berlin”; enum Color { Red, Green, Blue }; “basic.ts”
var answer = 4; var n = [1, 2, 3];
var city = “Berlin”; var Color; (function (Color) { … } “basic.js”
var foo: any; var foos: any[]; function log(msg): void {
… } var fAdd: (x: number, y: number)=>number; “func.ts”
var foo; var foos; function log(msg) { … } var
fAdd; “func.js”
FIND REFERENCE src/services/extractor.ts function extract(data: Article[], topic: string) src/services/storer.ts ArticleExtractor.extract(data,
defaultTopic)
PROBLEM ZWEI
function extract( data, topic ) { … }
INTERFACES
interface Article { _id: string; url: string; date?: Date; title:
string; text: string; }
function extract( data: Article[], topic: string) { … }
extract(articles, “bar”);“ ✔ extract(“foo”, “bar”); ✗ Argument of type “string”
is not assignable to parameter of type Article[] ^^^^^
MORE STUFF
Type Inference Classes Modules Default parameters Optional parameters Generics Union
Types Intersection Types
INTEGRATING 3RD PARTY LIBS / FRAMEWORKS
DefinitelyTyped
EDITOR SUPPORT
None
MIGRATION
> npm install -g typescript > mv *.js *.ts >
tsc -w -m commonjs server.ts
SUMMARY
PRO CONTRA Optional TYPE SYSTEM Compiles to plain JS Compile
Step ES5/(ES6) compatible
LINKS typescriptlang.org http://basarat.gitbooks.io/typescript/