Functional Principles - Immutability
Example: CreateAddress must be called before CreateCustomer and both must be called before SaveCustomer.
Solution: now CreateCustomer cannot be built unless address exists, therefore the incorrect order will not compile. Also the code is clearer as we immediately understand their dependencies and output.
It is not possible to remove mutability entirely, but it should be minimised.
Comments
Post a Comment