4 ms·
If you have a datetime object you can stop thinking about the fact that it's internally implemented with e.g. ticks since the epoch. In fact, you don't care any
by sklivvz1971 13y ago
If you have a datetime object you can stop thinking about the fact that it's internally implemented with e.g. ticks since the epoch. In fact, you don't care anymore what data it depends on, because you only depend on behaviors.
- weavejester 13y agoThat's more polymorphism than encapsulation.
- sklivvz1971 13y agoI was thinking more in terms of different versions of the same library, which is clearly one of the reasons why we have encapsulation :-)
- weavejester 13y agoI can see encapsulation being useful in that case, though I'm of the opinion the use-cases for encapsulation don't outweigh the disadvantages it brings.
- deleted 13y ago[deleted]
- chongli 13y agoThat's called data abstraction. You don't need classes or mutable objects to implement data abstraction.