3 ms·
I agree, if you can make the object imutable by setting all it's fields at construction time then it is great, if you have to update the object then is good to
by simion314 9y ago
I agree, if you can make the object imutable by setting all it's fields at construction time then it is great, if you have to update the object then is good to use setters or functions that can perform validation, it makes it easy to catch errors earlier.