Is TimeSpan unnecessary?

后端 未结 9 1947
野的像风
野的像风 2020-12-15 06:33

EDIT 2009-Nov-04

OK, so it\'s been a little while since I first posted this question. It seems to me that many of the initial responders failed to r

9条回答
  •  隐瞒了意图╮
    2020-12-15 07:08

    One reason is that splitting the types prevents a class of bugs where you think you have a relative time but really have an absolute time, and vice versa. For example, addition of two absolute times can be flagged as a compiler error if the two types are separate.

    Also, IntelliSense (and discovery for newbies) works better when the number of members is smaller-- by splitting methods between the two types, working with each gets easier.

提交回复
热议问题