3 ms·
Static types give me three things: Static analysis, safety and performance. With optional static types you get the analysis with some safety and maybe a little
by discreteevent 11y ago
Static types give me three things: Static analysis, safety and performance. With optional static types you get the analysis with some safety and maybe a little performance.
Safety is a time saver. Without static types you have to write a lot more code in the form of unit tests than amount of code it takes to put in some type annotations.
Static analysis is an even bigger time saver. Suppose I have to decipher someone else's code (or even my own). I can get a machine to definitively show me the call hierarchy of a function. That's not just all the call sites, but the complete call stack for every case. This immediately gives me a huge insight into the design (or lack of it) of the program. To do this with grep or a debugger potentially increases that time exponentially.