3 ms·
I studied clean a very long time ago, maybe 20 years, so I have no idea any more what the code looks like, but I can attempt to tell you the basic idea of this.
by cjfd 5y ago
I studied clean a very long time ago, maybe 20 years, so I have no idea any more what the code looks like, but I can attempt to tell you the basic idea of this. There are objects that you cannot copy and also not use in multiple places as a function argument. E.g., if something is a file it is subject to these restrictions and functions that write to the file would accept the file as an argument and return a new object of type file that stands for the modified version of the file. This forces an explicit sequencing of side effects. This prevents the old version of the file still being usable in the code.