Strong Typing vs. Strong Testing (2003)
docs.google.com
docs.google.com
def distance(a, b)
vs def distance(a: string, b: string): decimal
Would you have guessed from the first signature that I'm calculating the distance between two strings rather than the distance between two points? Or the fact that the returned distance can be decimal rather than strictly integral?Yeah, I could name my function
distance_between_strings_where_decimal_distances_are_allowed(a, b)
but it's more concise, just as effective, and compile-time-checked to write distance(a: string, b:string): decimal