For me, the most important reason is that static typing makes the code much more self-documenting.
I can see what that function is returning, and if it's something unknown I can go to the type declaration and see what I can do with that type.
This is entirely unlike dynamic typing where you have to pray the docs are very good and up to date, which frequentlyis not the case.
For me, the most important reason is that static typing makes the code much more self-documenting.
I can see what that function is returning, and if it's something unknown I can go to the type declaration and see what I can do with that type.
This is entirely unlike dynamic typing where you have to pray the docs are very good and up to date, which frequentlyis not the case.