• Andrew (unregistered)

    I haven't programmed for .NET in some time. I thought this was C# but there are, apparently, some new things in the language with which I'm not familiar: e.g. return ((Stop ?? _now) - Start).Seconds;. Of great frustration when I began programming in C# is that the APIs were so vast, it was quite difficult to know (and more difficult to locate) what was actually out there for one to use. Granted, for time related stuff, some Googling would probably have cleared it up, but getting what you need from the API or MSDN: I haven't always found it simple to extract. It's like when I started down the UNIX path. I was frequently told, "All you need to do is 'man <command>'." Well, I didn't know that "man" was a command.

  • a n o n (unregistered)

    I really hope this was just copy and pasted from a class the actually used a stop date. If he came up with this first... well I hope he isn't there any more.

  • SolePurposeOfVisit (unregistered)

    That "null" thing, btw -- it wouldn't be a problem at all if the guy had used the Null Object Pattern. Well, actually, it would, because in this case null doesn't just not mean null, it also doesn't mean "default behaviour." But a Null Object implementation might have been a good start. Of course, for everything else ... as so often in these cases, one has to ask: where and by whom was this code-reviewed?

  • wpfsucks (unregistered)

    why put all the logic in viewmodel?

  • djingis1 (unregistered) in reply to SolePurposeOfVisit

    You know the answer to that question, don't you?

  • urkerab (nodebb) in reply to Andrew

    man man...

  • doubting_poster (unregistered)

    this is only half of the code, the other half would be the non-open-ended events, where Stop would presumably not be null. The 'WTF's in this code are minor criticism. Bad article!

  • Robin Bobcat (unregistered)

    I am just wondering why the heck it needs the granularity of calculating down to the second. Minutes I can see - half hour seminar, or a quick break in a day-long schedule - but unless someone is up there with a stopwatch, seconds are a bit much. Doing it to the hour (and percentages therof) should be fine

  • komalvarshney (unregistered)
    Comment held for moderation.
  • Government Jobs (unregistered)
    Comment held for moderation.

Leave a comment on “Eventful Timing”

Log In or post as a guest

Replying to comment #:

« Return to Article