Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Proposal: Properties should not be of type Task or Task<T> #23

Open
vweijsters opened this issue May 6, 2015 · 3 comments
Open

Proposal: Properties should not be of type Task or Task<T> #23

vweijsters opened this issue May 6, 2015 · 3 comments

Comments

@vweijsters
Copy link

Inspired by #21:

Properties should not be of type Task or Task<T>.
Most people perceive properties as near instantaneous (synchronous) operations.
Task and Task<T> are associated with asynchronous operations and should therefore not be used as property types, as this does not match with the expectations of the majority of developers.

@ChrSteinert
Copy link

While this is old, is it still up for debate?

@sharwell
Copy link
Member

@ChrSteinert Sure, feedback is always welcome. 😄

@ChrSteinert
Copy link

Ok, so here I go 😉

Having a Task as the type of a property must not always be a "bad" thing. I remember some custom task runner I once wrote (with retry policies and stuff). At least the internal bits had Tasks as fields and properties. This scenario seems small, so I'd rather vote for a warning. Also, even in this scenario, having a property, which, by the semantics of a property, is supposed to be publicly exposed, with type task seems worth a warning for above mentioned reasons. So pleas, let's make it a thing ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants