You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a reason for static readonly CachedExpressions not to work and instead allow status CachedExpression { get; } only? This doesn't make much sense to me because I typically never change the value of those and I would like to express that in my code.
The text was updated successfully, but these errors were encountered:
Using an auto-property without setter is basically the same as a read-only field, since the compiler generated getter function accessing the read-only field behind shouldn't generate any overhead / gets inlined anyway. But you can make changes in the future and (more important maybe) add a break point on any getter. Thus, it's generally considered a good practice not exposing any fields, but using properties / functions instead.
Howsoever, the functionality of NeinLinq is build on functions; property getters are functions (with limitations) too. I am not sure how extending this functionality for field access would bloat the processing underneath - if it's less efficient to support both ways, I wouldn't support it.
As of now I don't know what supporting both, functions and "raw" field access would "cost". There wasn't any demand until now.
Is there a reason for
static readonly CachedExpression
s not to work and instead allowstatus CachedExpression { get; }
only? This doesn't make much sense to me because I typically never change the value of those and I would like to express that in my code.The text was updated successfully, but these errors were encountered: