@@ -124,6 +124,7 @@ <h3 class="fragment">IMHO type systems make code easier to maintain</h3>
124124 < li > can make code easier to analyse
125125 < li > can allow for reliable refactoring
126126 < li > can allow for generally better IDE support
127+ < li > can catch errors early
127128 </ ul >
128129 </ section >
129130
@@ -187,7 +188,7 @@ <h3>TypeScript</h3>
187188</ code > </ pre >
188189 < pre class ="fragment "> < code class ="typescript " contenteditable data-trim >
189190
190- // return type can be inferred
191+ // types can be inferred (return type)
191192function sayIt(what: string) {
192193 return `Saying: ${what}`;
193194}
@@ -244,11 +245,13 @@ <h3>Flow</h3>
244245 </ section >
245246
246247 < section >
247- < h3 > Right, pretty much the same</ h3 >
248+ < h2 > Right, pretty much the same</ h2 >
249+ < p class ="fragment "> Those basic features help with documentation, refactoring, and IDE support</ p >
248250 </ section >
249251
250252 < section >
251253 < h2 > Non-Nullable Types</ h2 >
254+ < h4 class ="fragment "> Talking about correctness</ h4 >
252255 </ section >
253256
254257 < section >
@@ -284,19 +287,20 @@ <h3>TypeScript</h3>
284287 < h3 > Flow</ h3 >
285288 < pre class ="fragment "> < code class ="typescript " contenteditable data-trim >
286289function foo(num: number) {
287- if (num > 10) {
288- return 'cool';
289- }
290+ if (num > 10) {
291+ return 'cool';
292+ }
290293}
291294
292- // error: call of method `toString`. Method cannot be called on possibly null value
295+ // error: call of method `toString`.
296+ // Method cannot be called on possibly null value
293297console.log(foo(100).toString());
294298</ code > </ pre >
295299 < p class ="fragment "> Flow does catch this</ p >
296300 < p class ="fragment "> But why?</ p >
297301 </ section >
298302 < section >
299- < h3 > Flow does not infer string as the return type</ h3 >
303+ < h4 > Flow does not infer string as the return type</ h4 >
300304 < p class ="fragment "> The inferred type is something else</ p >
301305 < pre class ="fragment "> < code class ="typescript " contenteditable data-trim >
302306 // error: return undefined. This type is incompatible with string
@@ -344,6 +348,7 @@ <h2>Non-nullable types</h2>
344348 < section >
345349 < h2 > Generics</ h2 >
346350 < h3 class ="fragment "> aka Parametric Types</ h3 >
351+ < h4 class ="fragment "> might be a bit scary...</ h4 >
347352 </ section >
348353
349354 < section >
0 commit comments