4 ms·
Please don't dismiss optional typing without trying it first. Even if you don't add any type annotations yourself, you'll still benefit from the annotated libr
by ahoge 12y ago
Please don't dismiss optional typing without trying it first.
Even if you don't add any type annotations yourself, you'll still benefit from the annotated libraries and from type inference.
To get almost all of the tooling benefits, you only have to annotate arguments and the return value. That's it. Inside your functions you generally can omit them because there are enough types floating around. Literals have a type and if you call an annotated function, you also know what type you get back.
E.g. this function is fully typed (none of the variables is purple):
http://i.imgur.com/xHWlJVn.png http://i.imgur.com/xHWlJVn.png
- bcheung 12y agoI'm not dismissing optional typing at all. I'm completely for that. I have used it in JS when performance is needed when dealing with large data sets. It's forced static typing that I am against.
- olavk 12y agoWhy are you talking about forced static typing when the presentation is talking about optional typing?