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
TypeScript vs Flow
Search
Craig Bruce
November 26, 2015
Technology
1
660
TypeScript vs Flow
An overview of 2 of the most popular type checking tools in the JavaScript ecosystem
Craig Bruce
November 26, 2015
Tweet
Share
Other Decks in Technology
See All in Technology
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
100
Lexical Analysis
shigashiyama
1
150
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
930
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
170
【若手エンジニア応援LT会】ソフトウェアを学んできた私がインフラエンジニアを目指した理由
kazushi_ohata
0
140
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
130
強いチームと開発生産性
onk
PRO
33
11k
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
1
1.6k
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
1
280
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
6
2.6k
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
43
13k
Building Adaptive Systems
keathley
38
2.3k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Being A Developer After 40
akosma
86
590k
The Cult of Friendly URLs
andyhume
78
6k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Faster Mobile Websites
deanohume
305
30k
A better future with KSS
kneath
238
17k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Transcript
TYPE CHECKING TypeScript vs Flow
JAVASCRIPT TOOLING IS NOT NEW
MINIFICATION
STATIC ANALYSIS
LINTERS
TRANSPILERS (COFFEES#!T)
THE BLURB
TYPESCRIPT “A TYPED SUPERSET OF JAVASCRIPT THAT COMPILES TO PLAIN
JAVASCRIPT”
FLOW “ADDS STATIC TYPING TO JAVASCRIPT TO IMPROVE DEVELOPER PRODUCTIVITY
AND CODE QUALITY”
BOTH HAVE SAME GOALS
BACKGROUND - FLOW
FACEBOOK CREATED REACT
CODE BASE & TEAM GETTING LARGE - BUGS CREEPING IN
LOOKED AT CLOSURE COMPILER BUT REQUIRED “TOO MUCH CARE”
LOOKED AT TYPESCRIPT BUT REQUIRED “DEVS TO DO JS DIFFERENTLY”
WRITTEN IN OCAML
BACKGROUND-TYPESCRIPT
MICROSOFT WANTED TO ADDRESS JAVASCRIPT’S SHORTCOMINGS FOR LARGE PROJECTS
THEY ALSO WANTED TO BRING FUTURE ES6/7 PROPOSALS FORWARD
AND GIVE JAVASCRIPT FIRST CLASS TOOLING SUPPORT FOR EDITORS
STRONG UPTAKE - EVEN ANGULAR 2.0 IS WRITTEN IN TYPESCRIPT
google —microsoft
WHY DO WE CARE?
TYPES CAN BE YOUR FRIEND
TYPES CAN SERVE AS DOCUMENTATION FOR FUNCTIONS
THE COMPILER IS YOUR FIRST UNIT TEST
TOOLING CAN AID PRODUCTIVITY
NOT EVERYONE AGREES
“ I think that JavaScript's loose typing is one of
its best features and that type checking is way overrated. TypeScript adds sweetness, but at a price. It is not a price I am willing to pay -Douglas Crockford
“ A word of warning Making previously-untyped code typecheck with
Flow may take some time and work - and sometimes it may not be worth the effort in the short term -facebook
None
YOU CAN STILL DO DYNAMIC JAVASCRIPT don’t panic
SYNTAX
TYPE ANNOTATIONS
TYPE ANNOTATIONS
None
ARRAYS
None
ENUMS
None
INTERFACES
INTERFACES
INTERFACES
INTERFACES
UNION TYPES
UNION TYPES
GENERICS
`
`
WORKING WITH 3RD PARTY LIBRARIES
TYPESCRIPT - .D.TS FILES FLOW - ‘INTERFACE’ FILES
None
None
ALTERNATIVELY
HTTP://DEFINITELYTYPED.ORG/
REACT
TYPESCRIPT - .TSX FILES FLOW - OOTB
None
None
TOOLING
TYPESCRIPT HAS RICH EDITOR SUPPORT
FLOW HAS LIMITED SUPPORT - ATOM NUCLIDE
THE FUTURE
TYPESCRIPT - ASYNC/AWAIT AND LOTS OF ES2016 FEATURES https://github.com/Microsoft/TypeScript/wiki/roadmap
FLOW - CONVERT TYPESCRIPT .D.TS BETTER IDE SUPPORT MOVE FROM
OCAML TO JS http://flowtype.org/docs/coming-soon.html#_
ALTERNATIVES
ELM PURESCRIPT http://elm-lang.org/ http://www.purescript.org/