DenkzeitWiki

Suchen:

Aktuelle Änderungen Printable View Änderungen Bearbeiten

SimonPeythonJones > SimonPeytonJones > SimonPeytonJones > SlickRun > AppLauncher > SmartPointer > SnakesAndRubies > WebApplications > SoftwareArcheology > SoftwareEntwicklung > SoftwareDevelopment > SpielzeugAusBambus > Spyce > Stack > Heap > StatementsAndExpressions > StaticVsDynamicTypingArgumentsClear Trail
Main /

Static Vs Dynamic Typing Arguments

StaticVsDynamicTyping

ErrorsFoundByCompilers

Different kinds of typing

Type inference may quack like dynamic typing, it may walk like dynamic typing, and it may fly like dynamic typing, but it doesn’t swim like dynamic typing. [1]


Pro static

Imagine, for example, that, in OCaml, you can't pass a file handle that was not opened for reading into a function that will read from it. That is an error that is stopped statically.

This means that the type checker has found an infinite loop bug in our program. Ponder that for a minute.


Con static

A type system is a set of tests. It's just the set of tests a language designer could invent without seeing your program. The tests are hard-coded in the compiler and it would be nice to have more control over them. [2]


I've been struggling with this general problem for a long time. That is, the "logical" arguments that are very hard to refute, like "software is created by typing." True on the surface, but not really the essence of the issue. But if you keep the argument on those terms, you can't really get anywhere, because the logic is irrefutable. Even if that logic completely misses the real issue.
This is probably why I keep fighting with the static-dynamic language debate, because it has the same feel to me. You can come up with all kinds of reasons that static checking is a good thing, until you have an experience programming in a dynamic language where you are vastly more productive than with a static language. But that experience defies the logic used to back up the reasoning behind static languages.Programming as Typing



Pro dynamic

And here we run into a major disconnect. To the enterprise, scripted solutions look like one-offs, not strategic systems designed to high standards of quality and able to evolve along with the business. What the enterprise folks don't get is that scripted systems can be engineered to meet these requirements. So they lean toward C++ and Java, and then rely on powerful integrated development environments, like Eclipse and IntelliJ IDEA, to make fluid refactoring possible. These tools can work very well. "They're complicated," observes Ward, "and you have to learn how to work them -- but boy, when you do, they make those languages start to feel like scripting languages."[6]


Con dynamic

As our system has grown, a lot of the logic in our Ruby system sort of replicates a type system, either in our unit tests or as validations on models. I think it may just be a property of large systems in dynamic languages, that eventually you end up rewriting your own type system, and you sort of do it badly. You’re checking for null values all over the place.




The debate

Ultimately, I have found that big programs written in dynamic languages don't age as well as those written in a statically typed language because developers are more afraid to refactor them.


Edit - BackLinks - Tags - Page Hist - Print - Changes - Home - Orphans - Help

Zuletzt geändert am 05.04.2009 19:38 Uhr und seit 7. April 2005 967 aufgerufen.