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
Hack - Why Should I Care?
Search
Joel Clermont
April 23, 2015
Programming
0
58
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
How to get unstuck
jclermont
0
87
Level Up Your Code Quality
jclermont
0
290
How to Save Time
jclermont
0
30
F# Type Providers
jclermont
0
68
Give Elm a Chance! (that conference)
jclermont
0
240
Give Elm a Chance (newCodeCamp)
jclermont
0
220
Give Elm a Chance!
jclermont
0
240
Property-based testing: work harder, not smarter
jclermont
0
390
Elm - A new approach to building the front end
jclermont
0
370
Other Decks in Programming
See All in Programming
Scala におけるコンパイラエラーとの付き合い方
chencmd
2
400
状態管理ライブラリZustandの導入から運用まで
k1tikurisu
3
440
Prolog入門
qnighy
4
980
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
240
Rubyとクリエイティブコーディングの輪の広がり / The Growing Circle of Ruby and Creative Coding
chobishiba
1
260
マイグレーションコード自作して File-Based Routing に自動移行!! ~250 ページの歴史的経緯を添えて~
cut0
1
260
LangGraphでのHuman-in-the-Loopの実装
os1ma
3
990
New Order in Cascade Sorting Order
mugi_uno
3
2.6k
僕が思い描くTypeScriptの未来を勝手に先取りする
yukukotani
9
2.3k
今インフラ技術をイチから学び直すなら
yuhta28
1
120
GoのIteratorに詳しくなってしまう
inatonix
1
200
Amebaチョイス立ち上げの裏側 ~依存システムとの闘い~
daichi_igarashi
0
230
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
248
20k
The Cost Of JavaScript in 2023
addyosmani
41
5.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5k
How to name files
jennybc
75
98k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
45
4.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
52k
Into the Great Unknown - MozCon
thekraken
28
1.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
35
6.8k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Web development in the modern age
philhawksworth
204
10k
What the flash - Photography Introduction
edds
67
11k
A Modern Web Designer's Workflow
chriscoyier
691
190k
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