Interesting new implementation of DateTime.Now.Date
-
@antiquarian said in Interesting new implementation of DateTime.Now.Date:
Please tell us that the developer who wrote it was cast into the same abyss.
They tried, but he escaped by throwing an invalid cast exception.
-
@iughruthlir said in Interesting new implementation of DateTime.Now.Date:
Will calling this method awaken dead Cthulhu from his slumber of aeons?
Slight chance it might, if run sufficiently near to a month (or worse, a year) transition.
-
@boomzilla said in Interesting new implementation of DateTime.Now.Date:
hacky way of declaring them
Looks quite tidy to me, but then I'm generally unwilling to trust abstractions until I know how they're typically implemented, so I don't mind being reminded that methods are almost always implemented as functions with
this
passed as a hidden first parameter.I like this quite a lot more than JavaScript's
.call
mechanism for doing essentially the same thing.I also quite enjoy the violence that the existence of any kind of extension method mechanism does to the sacred notion of encapsulation.
-
@blakeyrat said in Interesting new implementation of DateTime.Now.Date:
it's an understandable mistake
though I've never really understood how you manage to pound in that last nail.
-
@flabdablet With an old shoe, or possibly a glass bottle.
-
@FrostCat That much is obvious. But how does he wield it? That's the part that gets me.