4 ms·
I think that you are comparing static vs dynamic typing but the grandparent comment is more about strong vs weak typing. If instead of having separate Person a
by ufo 10y ago
I think that you are comparing static vs dynamic typing but the grandparent comment is more about strong vs weak typing.
If instead of having separate Person and Address types you just use strings for everything (even "lists" can be strings - just keep the data serialized into HTML, or XML) then you can your program is likely to "do something" if you just compose a bunch of functions together. Sure, your code might have a bunch of logic bugs (like HTML injection / XSS) but at least it does something!
Static typing is great once you leave this "stringly typed" world and start separating your values into strongly-typed types. When you get a type error from passing a value to the function then its nice if you can be warned about this at compilation time.