Functional Programming, Csharp, Programming.
can add more numbers to the collection causing side effects for the calling code. This can be avoided with the use of an immutable interface: public int Sum(IReadOnlyList<int> numbers) { . . . } Things get more complicated with objects. Let’s say we have the next class: class User { public int Name