3 ms·
> “Not having to” write types but having to think about them anyway is like doing math “not having to” write anything down and doing all calculations in your he
by comex 6y ago
> “Not having to” write types but having to think about them anyway is like doing math “not having to” write anything down and doing all calculations in your head. How is it an advantage to not use pen and paper to track down your train of thought as you do a complex calculation, and instead be restricted to do it only in your head?
If dynamic type systems are like not having pen and paper, then static type systems are like a teacher forcing you to "show your work" by writing every little step on pen and paper, no matter how obvious. What's interesting is finding good middle grounds.
- tupshin 6y agoStatic typing with inference being the most obvious of those. Gradual typing being another
- tluyben2 6y agoSo a typechecker which can infer types so well that it feels almost dynamic but is in fact static, like Ocaml (vs something like c# where I have to write type signatures which are completely obvious to infer).
- Mountain_Skies 6y agoThat depends on the version of c#. MyObject obj = new MyObject(); can also be expressed as var obj = new MyObject(); or MyObject obj = new(); Neither of these were possible in early versions of c# but both are there now.