3 ms·
I spent a couple of decades with static typing (mostly Java) before spending another 5 years doing nothing but JavaScript. I definitely, I initially like the f
by phil_kahrl 4y ago
I spent a couple of decades with static typing (mostly Java) before spending another 5 years doing nothing but JavaScript. I definitely, I initially like the freedom of dynamic typing and one could argue that as long as you have sufficient tests in place, one is not better than the other. In practice, when working on a team, dynamic typing tends to fall short because it's difficult to enforce the patterns that are needed to actually have a maintainable code base. With dynamic typing different opinions about what patterns should be used in dynamic typing has lead to chaos where each team has to invent their own versions of accepted patterns meaning that each development team becomes an island of their own invention. Human progress relies on organizing many individuals with the same purpose and same way of doing things, which is very difficult to do with dynamic typing.
- sparker72678 4y agoCan you give an example where static typing enforces a pattern? I feel like that problem exists at the human level, where language would not make a difference, but maybe I'm overlooking something.
- phil_kahrl 4y agoProgramming to interfaces not implentation is at least encouraged if not outright enforced.
- ncmncm 4y agoJava doesn't count. Neither does C, Pascal, etc. Languages where the only role of types is bondage-and-discipline are not meaningful for comparison.
- sparker72678 4y agolol, I find that metaphor apt for quite a few languages I've worked with!
- didibus 4y agoBut "bondage-and-discipline" is the only advantage in my opinion. It's because you have new-grads, juniors, people rushing through tasks, people new to the code base, new to the language, that's why on larger projects at companies forced "bondage-and-discipline" languages are hard not to use.
- avinassh 4y agoWhich languages count?