Type systems and unit tests have something in common: they are both in the category of 'documentation', alongside comments.

They differ from coments in that they are designed to be machine-interpretable, but like comments they do not modify the behavior of the code if stripped out. This is the key principle of documentation: it's additional information in a program that does not modify the behavior of the program when it is stripped out.

They are vital for ensuring the correctness of the program. But 'correctness' is a human concept; programs do not care.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.