by ben509 · 5y ago · 0 comments
That's a consequence of the "always mutable" model whereby the responsibility of initialization can be shared by the object constructor and the caller.
But there are many cases where it's very intuitive for the caller to set up an object, especially in the objects as actors model.
I think to make that work, you'd want to track the evolution of the object's state, especially noting when all fields have defined values.
I've seen all these approaches in Rust.
It's not though. An "always mutable" model can require that objects be fully initialised up-front. Rust does exactly that.