11 ms·
Agreed. I often find that most people who are very enthusiastic about dynamic typing have only seen it in action on solo or small projects. Add complexity or p
by incepted 11y ago
Agreed. I often find that most people who are very enthusiastic about dynamic typing have only seen it in action on solo or small projects.
Add complexity or people and dynamic typing quickly crumbles.
- dgritsko 11y agoI made this point in an earlier comment, but I'm a firm believer that if the speed at which you can physically type code is the bottleneck, then you are going to eventually have much bigger problems. Hastily written code will require more time to fix than it will cost you to slow down and think about a good design, regardless of language.
- pekk 11y agoTo represent the case for dynamic languages as "the speed at which you can physically type code" is a straw man.
- dgritsko 11y agoI agree, I think there are many more issues to consider. However, the OP seemed to be focusing on that particular argument, hence my comment. A few examples: "The results were that the people using the dynamic version of the language got stuff done much quicker" "it took less time to find those errors [in the statically typed language] than it did to write the type safe code in the first place [in the dynamically typed language]." "[programs written in]" dynamic languages took significantly less effort to create (less time)"
- bjourne 11y agoIf you can code quickly, then the effort required to refactor previously written bad code is lower. I.e it is not that you can type faster that matters, it is that you can fit more change iterations in the same time frame. And many times multiple change iterations are required because you can't see beforehand whether a particular refactoring will be a net positive or negative.
- habitue 11y agoStrongly typed languages beat dynamic languages hands down for refactoring. The ability to know immediately what broke without having to run all your code paths dominates any time savings gained by typing faster. I'm a fan of strongly typed languages with good type inference (and therefore less typing), but even in verbose languages like Java this is true about refactoring.
- NhanH 11y agoThe effort of writing (typing) code is directly (at least) linearly proportional with the effort of reading said code (including the time when you're thinking in your head before you typed it in). And by "effort", I'm strictly referring to the physical aspect of reading the text, disregard the comprehension part. As many advocates of static typing emphasize the importance of reading/ refactoring in large code base, this would be a huge factor as well.
- marcosdumay 11y agoI do agree with the arguments here literally, but I think they sound much more forbidding than they should be. There are plenty of big projects around that could broken into a collection of small, independent projects without any loss.
- Touche 11y agoI mean, unless you live under a rock you have to realize that there are a lot of complex non-trivial apps that run in languages like Python, JavaScript, and Ruby.
- incepted 11y agoSure, but that doesn't prove anything besides the fact you can write apps in any language. The question is more: would writing these apps in a statically typed languages have been "better" along certain axes (easier to maintain, easier to write, easier to evolve, easier to debug, faster to ship, easier to recruit for, easier to ramp up newcomers on the team, etc...).
- Touche 11y agoYou said that it "quickly crumbles". What exactly does that mean? Sounds like you are softening your stance now, so why even so something so definitive?
- incepted 11y agoBecause automatic refactoring tools are not available for dynamically typed languages, programmers are more hesitant refactorings. So the technical debt accumulates and the code gets worse because of that death spiral. That's what I mean when I said that dynamically typed languages crumble under large code bases.
- StreamBright 11y agoAlso in Erlang and Clojure. I think one of the most reliable software systems of all time was written in Erlang. http://www.ericsson.com/news/141204-inside-erlang-creator-joe-armstrong-tells-his-story_244099435_c http://www.ericsson.com/news/141204-inside-erlang-creator-jo...
- kqr 11y agoErlang is popularly used with an external static type checker, the Dialyzer.
- jernfrost 11y agoI disagree, I warmed to dynamic typing specifically due to the experience of working with 2-3 million lines of C++ code. The problem with static typing at that size is that you very frequent impedance mismatch. A lot of the code you write ends up being about translating from one type to another which is almost identical. You also get dependency problems you don't have with dynamic languages because you aren't required to import type definitions to use an object from somewhere else. Your code easily get tightly coupled. You end up with a nightmare of compile times. The couplings get so intricate over time that it becomes and almost intractable problem to figure out how to take it apart. That is much easier in a dynamic language. You can tackle problem far more independently from each other because dynamic languages don't impose as much dependencies between types.
- incepted 11y ago> You also get dependency problems you don't have with dynamic languages because you aren't required to import type definitions to use an object from somewhere else The dependency is still there, you are using that object in your code. Dynamically typed language gives you the worst of both worlds: same dependencies and zero discoverability. > You can tackle problem far more independently from each other because dynamic languages don't impose as much dependencies between types. This doesn't make sense. The code is exactly the same except that you don't have type annotations with dynamically typed languages. In other words, you can't tell exactly how the code you're looking at interacts with the rest of the code base. Which makes it impossible to untangle when it grows and also for automated tools to figure out what these dependencies are.
- esailija 11y ago> The code is exactly the same except that you don't have type annotations with dynamically typed languages. No they are not the same. Here's some key differences: - If at runtime an execution doesn't even reach the code, then it doesn't matter at all for that particular execution whether the types were "correct". With static typing you need to get it right for all possible executions before you can even compile, regardless of how unlikely or unimportant those executions are. In practice, having to get it all right for all executions before you can even run one is a massive productivity loss in a lot of scenarios. - Not only might a "type" of something in a dynamic language not be expressible statically (at least in majority of static languages) in the first place, dynamic code is never dependent on any particular type. You might get an unintended "type" in and the code can still work. There is a dependency on infinite amount of unexpressible "types". You are completely ignoring the point of dynamic typing and you are using it as if it were static typing without annotations, by your own admission. But that's your problem. Similarly I could also use statically typed language as if it were dynamic and then claim that static typing is exactly the same as dynamic except more verbose.