> In Ruby, unit tests stand in place of static compiler checks. I haven't heard a strong argument against them nor a replacement for them.
How about static compiler checks? :)
How about static compiler checks? :)
def foo(x):
print x
return foo
This function has no computable type (in a standard system anyway); it's "a -> a -> a -> ...". However it's perfectly obvious what it does, and conceivable that it or similar functions might exist and be useful in actual code. Dynamic languages allow behaviors which are impossible in statically typed languages (properties created at runtime are another example).Of course, one could use gradual typing to get around some of this.
My 2 cents: Combine static(ish) typing with tests and a number of (semi-manual) test scenario's and you get a few steps closer to a correctly working piece of software.
I don't think static typing is necessary in that case, but I understand it has benefits in some situations.