While curiosing on the main page of a scripting programming language's site, I encountered this passage:When a system gets too big to keep in your head, you can add static types.This made me remember that in many religion wars between static, compiled languages (like Java) and dynamic, interpreted languages (mainly Python because it's more used, but it's an issue shared between most scripting languages), one of the complains of staticly typed languages' fans over dynamicly typed languages is that they don't scale well to bigger projects because one day, you'll forget the return type of a function and you'll have to look it up, while with staticly typed languages everything is explicitly declared.I never understood statements like this one. To be honest, even if you declare the return type of a function, you can and will forget it after you've written many lines of code, and you will still have to return to the line in which it's declared using the search function of your text editor to check it.As an addition, as functions are declared with type funcname()..., whitout knowing type you will have to search over each line in which the function is called, because you only know funcname, while in Python and the like you coud just search for def funcname or function funcname which only happens once, at the declaration.More over, with REPLs it's trivial to test a function for it's return type with different inputs, while with staticly typed languages you would need to add some lines of code and recompile everything just to know the type declared.So, other than to know the return type of a function which clearly isn't a strenght point of staticly typed languages, how is static typing really helpful in bigger projects?
How is static typing really helpful in bigger projects?
programming languages;dynamic typing;static typing