3 ms·
There's no law stopping you returning a new object from a method outside the builder pattern. Immutable objects are a pretty old idea, smalltalk had select (ma
by LAC-Tech 4y ago
There's no law stopping you returning a new object from a method outside the builder pattern.
Immutable objects are a pretty old idea, smalltalk had select (map) methods that returned a whole new collection back in the 80s.
- stickfigure 4y ago...and in fact most strings in OOP languages work like this: String next = original.substring(2);