Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • One such special case is when you have a DateTime object but are effectively ignoring either the Date or Time components. Commented Aug 5, 2014 at 14:35
  • Putting the type in the name doesn't feel right but as @Bart mentioned sometimes it cannot be avoided. Commented Aug 5, 2014 at 14:38
  • 1
    It depends a lot on the system- if I am in control of the code, I would avoid using a DateTime and then ignoring part of it, but sadly one isn't always in sufficient control to enforce even the most rational of whims. I find it particularly irritating when I have to go against good practice to fit in with another library, but often one can limit this to the library calls rather than allowing it to pervade our own code. Commented Aug 5, 2014 at 14:42
  • 1
    Hmm even skipping the Date part. Interesting. Might be an option. I do have the feeling it might clash in the future between a property Start and the verb Start() though. Commented Aug 5, 2014 at 14:45
  • 2
    You certainly wouldn't want a property and method with the same name, but depending on what you want start to mean you can name accordingly - Started if it is a record, StartAt if it is a schedule and so on. Or change Start() to Begin(), Commence(), Initiate() and so on :) Commented Aug 5, 2014 at 14:48