3 ms·
Have you ever written any ML/Haskell? It's nearly impossible to get past the type system unless your code is correct, especially for small chunks of code.
by wiggles 17y ago
Have you ever written any ML/Haskell?
It's nearly impossible to get past the type system unless your code is correct, especially for small chunks of code.
- jrockway 17y agoNo, he is right; however, Java has the exact problem. The place where this code will screw up is in the logic of the comparison routine. It will be difficult for the types of x and y (or a and b in the Java example) to be wrong, but it is easy to say: compare (length x) (length x) or compare (length y) (length x) instead of compare (length x) (length y) Your tests will catch this, though.