3 ms·
I've never seen .NET code that has magic properties hiding expensive operations, though my .NET experience is admittedly limited. Is that idiomatic?
by couchand 5y ago
I've never seen .NET code that has magic properties hiding expensive operations, though my .NET experience is admittedly limited. Is that idiomatic?
- ducharmdev 5y agoMaybe so; it's pretty normal to expect a property setter to perform additional operations, as it's necessary for making data binding more manageable among other things. But using Go to Definition takes me directly to the getter/setter, so imo it's not exactly hidden. I think it becomes problematic (or more magical) when these network/database/expensive calls are made willy nilly throughout an application, without a dedicated class or layer to aggregate these kinds of operations. If you have things architected correctly, it's not a big deal to trace these kinds of things throughout your app.