3 ms·
I think both the pitfalls of constructors and the benefits of factory methods are overstated. Go only supports factory methods, for example, and it’s probably t
by doctor_eval 4y ago
I think both the pitfalls of constructors and the benefits of factory methods are overstated. Go only supports factory methods, for example, and it’s probably the thing I like least about it. It makes dealing with default values in JSON really painful, for example.
Being able to put an object into a specific well defined state at the time of instantiation is really good.