3 ms·
Having moved to writing records by default in many places such as models and "DTOs", primary constructors are a very useful "transition" tool in those cases of
by WorldMaker 3y ago
Having moved to writing records by default in many places such as models and "DTOs", primary constructors are a very useful "transition" tool in those cases of "this started as a record, but now needs to be a mutable class for X reasons" and means a little bit less code to entirely rewrite in the first pass. It's also useful for even just "I aesthetically like for my class 'View Models' to mirror their record 'Model' definitions a little closer".