Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Hack - Why Should I Care?
Joel Clermont
April 23, 2015
Programming
0
48
Hack - Why Should I Care?
version given at Nomad PHP EU in April 2015
Joel Clermont
April 23, 2015
Tweet
Share
More Decks by Joel Clermont
See All by Joel Clermont
Level Up Your Code Quality
jclermont
0
100
How to Save Time
jclermont
0
19
F# Type Providers
jclermont
0
35
Give Elm a Chance! (that conference)
jclermont
0
80
Give Elm a Chance (newCodeCamp)
jclermont
0
86
Give Elm a Chance!
jclermont
0
130
Property-based testing: work harder, not smarter
jclermont
0
230
Elm - A new approach to building the front end
jclermont
0
190
Elm: A new approach to building the front end
jclermont
0
61
Other Decks in Programming
See All in Programming
Untangling Coroutine Testing (Droidcon Berlin 2022)
zsmb
2
490
Rust、何もわからない...#3
estie
0
170
Lookerとdbtの共存
ttccddtoki
0
670
「困りごと」から始める個人開発
ikumatadokoro
4
260
RustのWebフレームワーク周りの概観
hayao
0
180
Agile Tech EXPO_2022/カケハシ
kakehashi
0
110
アジャイルで始める データ分析基盤構築
nagano
1
920
Efficient UI testing in Android
alexzhukovich
2
130
FullStack eXchange, July 2022
brucel
0
200
10歳の minne から、これから長く続くプロダクトを作るすべての人へ
tsumichan
9
3.7k
パスワードに関する最近の動向
kenchan0130
1
330
回帰分析ではlm()ではなくestimatr::lm_robust()を使おう / TokyoR100
dropout009
0
4.6k
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
19
1.2k
GitHub's CSS Performance
jonrohan
1020
420k
Bash Introduction
62gerente
598
210k
Art Directing for the Web. Five minutes with CSS Template Areas
malarkey
196
9.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
316
19k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
351
21k
How to Ace a Technical Interview
jacobian
267
21k
Design by the Numbers
sachag
271
17k
Three Pipe Problems
jasonvnalue
89
8.7k
What’s in a name? Adding method to the madness
productmarketing
11
1.6k
KATA
mclloyd
7
8.9k
Making the Leap to Tech Lead
cromwellryan
113
7.4k
Transcript
Hack Why Should I Care? Joel Clermont @jclermont
What to expect • No insider secrets
What to expect • No insider secrets • High-level tour
of Hack’s unique features
What to expect • No insider secrets • High-level tour
of Hack’s unique features • Make the case why you should try it out
What to expect • No insider secrets • High-level tour
of Hack’s unique features • Make the case why you should try it out • Show you how to get started
What to expect • No insider secrets • High-level tour
of Hack’s unique features • Make the case why you should try it out • Show you how to get started • Answer all your questions
Quick Tour of Hack
Type Annotations
Type Annotations
Type Annotations
Type Annotations Where do we need them?
Type Annotations Where do we need them? 1
Type Annotations Where do we need them? 1 2
Type Annotations Where do we need them? 1 2 3
Type Annotations Where do we need them? 1 2 3
Type Annotations Where do we need them?
Type Annotations What do we get out of it? •
Easier for developers to understand intent
Type Annotations What do we get out of it? •
Easier for developers to understand intent • Correctness of our type system
Type Annotations What do we get out of it? •
Easier for developers to understand intent • Correctness of our type system • Easier to refactor
Doesn’t PHP already have type hints?
Doesn’t PHP already have type hints? • Scalar type hints
Doesn’t PHP already have type hints? • Scalar type hints
• Typed arrays
Doesn’t PHP already have type hints? • Scalar type hints
• Typed arrays • Nullable types
Doesn’t PHP already have type hints? • Scalar type hints
• Typed arrays • Nullable types • Function return type hints
Doesn’t PHP already have type hints? • Scalar type hints
• Typed arrays • Nullable types • Function return type hints • Type checker
More useful Hack types
More useful Hack types
More useful Hack types
More useful Hack types
More useful Hack types
Questions?
Still not convinced? DEMO
What’s wrong?
What’s wrong?
What’s wrong?
What’s wrong?
What’s wrong?
Solution 1
Solution 2
Solution 3
What’s wrong?
None
Solution
Questions?
More Cool Features
Lambdas
Lambdas
Lambdas
Lambdas
Collections Why would I need anything besides an array?
Collections Anyone know what this is?
Collections Hack gives us the right tool for each job
Collections Cleaner API
Collections Other nice features • Familiar interface
Collections Other nice features • Familiar interface • OutOfBoundsException
Collections Other nice features • Familiar interface • OutOfBoundsException •
Collections are objects (no more passing by ref)
Collections Other nice features • Familiar interface • OutOfBoundsException •
Collections are objects (no more passing by ref) • Immutable collections too
Trailing Commas You know you want them
And more . . . • User attributes • Enhancements
to traits • Async / await • Constructor promotion • Shapes • Type aliases . . . .
Questions?
Why should you consider it? Safety Language Features (Developer) Speed
Trying out Hack is not scary • Gradual process
Trying out Hack is not scary • Gradual process •
Full PHP interoperability
Trying out Hack is not scary • Gradual process •
Full PHP interoperability • Not just for multi-million line codebases
Trying out Hack is not scary • Gradual process •
Full PHP interoperability • Not just for multi-million line codebases • Awesome tooling
How to get started • Install HHVM (packages available)
How to get started • Install HHVM (packages available) •
Convert existing code with hackificator
How to get started • Install HHVM (packages available) •
Convert existing code with hackificator • Monitor logs for type errors
How to get started • Install HHVM (packages available) •
Convert existing code with hackificator • Monitor logs for type errors • Harden your types over time
Resources • Conversion guide http://docs.hhvm.com/manual/en/install.hack.conversion.php • HHVM blog http://hhvm.com/blog •
IRC channel #hhvm • http://hhvm.com/frameworks/ • https://github.com/facebook/hhvm/wiki/Extensions
grumpy-learning.com
Questions? @jclermont https://joind.in/talk/view/14452
Feedback please @jclermont https://joind.in/talk/view/14452
Thank you! @jclermont https://joind.in/talk/view/14452