3 ms·
IMHO this concept is better solved by using semantics, such as types, keyword parameters, interfaces, traits, etc: copy(source: ReadOnlyFile, destination:
by jph 7y ago
IMHO this concept is better solved by using semantics, such as types, keyword parameters, interfaces, traits, etc:
copy(source: ReadOnlyFile, destination: WriteOnlyFile)
These all help make the code more semantic, more testable, and more securable.
These can also improve more kinds of programming, such as a function that truly needs multiple parameters of the same type (e.g. iterators that are not commutative) or a function that benefits from security aspects (e.g. read-only data).