Martin Martin - 2 years ago 81
C# Question

Does a method name starting with "Does" look good?

Is it a good practice to start a method name with

(in C#)? It looks a little bit weird to me, so I would like to get your opinion.

I am writing a method which check if an account exists or not, should the signature be

bool DoesAccountExist(id)

Is there a better name?


Answer Source

Personally I'd go with AccountExists(id) in this case, since it will look more natural in an if block

if (AccountExists(id)) { }
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download