3 ms·
The static typing example seems weird to me. I did not read the entire linked summary but only the first five and last three papers discussed there and they mos
by danbruc 10y ago
The static typing example seems weird to me. I did not read the entire linked summary but only the first five and last three papers discussed there and they mostly hint at at least some positive effect for static typing but the author of the summary essentially just dismisses the results for various reasons. I am not saying that all the judgments in the summary are necessarily wrong but overall that summary seems a pretty strange basis for saying that static typing is worth nothing. And the author of the submission is also the author of the summary.
- tikhonj 10y agoThe conclusion I mead from that summary is not about the value of static typing one way or another but just that the empirical evidence on the matter is unclear and uniformly weak. Perhaps this is just a matter of will and funding, but I suspect it's because the underlying question is poorly specified and—like most human issues—extremely hard to study. To me, it's not obvious that asking about static typing in isolation from other parts of language design is meaningful at all.
- danbruc 10y agoIt is of course only anecdotal evidence but I know no developers using dynamically and statically typed languages that would deny the benefits of static typing per se. It's just a matter of fact that you get rid of a certain class of bugs that you have to otherwise cover with (unit) testing. There are of course drawbacks. If your language of choice does not offer type inference you have to write some additional boilerplate code but that may be countered to some extend by good tools with autocomplete and the like. You usually also get better refactoring tools with static typing. Then again it is sometimes harder to make something work because the type system is to restrictive and some duck typing would be really handy. It is a bit of a trade-off, some bugs go away, some code is harder to write. I guess that is what you are hinting at with looking at static typing in isolation. Nonetheless I still have to see a developer who confidently and unconditionally prefers dynamic typing over static typing, but maybe that is just some bias because of the places I work.
- ubernostrum 10y agoI know no developers using dynamically and statically typed languages that would deny the benefits of static typing per se. I guess technically you're right here, because what I would do is deny that you have the ability to define "static typing" (or "dynamic typing") in a meaningful way. It's just a matter of fact that you get rid of a certain class of bugs that you have to otherwise cover with (unit) testing. Well, I do occasionally see static-type refugees coming to Python and writing code littered with "assert isinstance(..." checks and the like. But sooner or later they either learn to stop doing that, or go back to their safe space with horror stories about how they had to do all that manual checking. People who stick around have learned you don't need to do that stuff, and I can't think of any code I've personally written in, say, the past five years which used tests or runtime type checks to try to catch type-related bugs. In fact over the past ten years I can only think of one time when a static type checker would've caught a bug that got as far as being committed.
- dllthomas 10y ago"I can't think of any code I've personally written in, say, the past five years which used tests or runtime type checks to try to catch type-related bugs. In fact over the past ten years I can only think of one time when a static type checker would've caught a bug that got as far as being committed." This is clearly a case of "you don't know what you don't know." I strongly suspect that there are many things you deem "not something static typing would catch" that I have been catching with static typing. From the trivial (passing bid price where ask is expected) to the simple (keeping track of which array this index is supposed to point into) to the tricky (restricting certain behaviors to certain threads). And those three examples were from my last big C project - no esoteric type system (some of which make it even more powerful and even more convenient). I won't go so far as to argue that extensive use of static checking is always a win, but it is a tool I find very effective. And it looks very little like "assert isinstance" strung about a Python codebase.
- danbruc 10y agoI guess technically you're right here, because what I would do is deny that you have the ability to define "static typing" (or "dynamic typing") in a meaningful way. A statically typed language is a language where the compiler uses type information about expressions at compile-time to check the validity of a program, otherwise it is a dynamically typed language.
- lambdasquirrel 10y agoIf you read the paper, the study was performed on Ph.d students and the language was Ansi C. >.> Make of that what you will.
- sklogic 10y agoBecause the author has an agenda, he's a dynamic typing and unit testing proponent. Do not expect anything even distantly resembling any kind of an objective science from someone who clearly is not interested in facts.
- dang 10y agoThis is pretty much a personal attack and those are not allowed here. Also, what you're saying doesn't match my recollection of luu's writings on this topic, which is that he's mildly in favor of static typing but changed his mind somewhat after looking at the dismal state of the evidence.
- irrational 10y agoWho is not interested in facts? Did you even read the linked article? If you read nothing else, at least read the summary. He makes very very clear that he is a static typing proponent.
- ArkyBeagle 10y agoI think it's more that - for obscure internal and path-dependent reasons - people divide into cohorts who are lukewarm about static typing and cohorts who are quite for it. His bit about it is purest hyperbole - "those who oppose static typing are like unto AGW deniers." As they say in Haskell circles - it's all fun and games until you invoke the I/O monad...