Builder Pattern in Rust
91–93 of 93 posts
Re: Builder Pattern in Rust
#92Earlier quoted context omitted.
At the risk of being pedantic, I would use separate types there for the id's to avoid this kind of issue, but in general I agree with your point
What would you do about a slice function? Without the parameter names you won't even see if the second parameter is length of the slice or its right end.
However I feel the best approach is to have first-class language support for parameter-arguments-to-type homomorphisms (e.g. `TArgs args = new( arg1, arg2, arg3 ); YourMethod( args );`).
Re: Builder Pattern in Rust
#93Earlier quoted context omitted.
Unfortunately hardly any ORMs support that (especially not EF, argh), and writing custom value-types is a painful experience given C# (still) doesn't support strict typedefs nor mixins.
If only structs were inheritable, then you could roll your own `struct Wrapper ` with operators for implicit conversion, equality, etc, and then extend it with just the name and type. Wouldn't help with the EF pain point though, and I'm sure it might confuse newcomers initially.