4 ms·
> This is not the same thing. The problem with the Go implementation is essentially that the method is semantically different from the expected method. No-one
by mseepgood 13y ago
> This is not the same thing. The problem with the Go implementation is essentially that the method is semantically different from the expected method.
No-one is arguing about the Close() case. However, the io.Copy() case is comparable to the IEnumerable<T>.Count() implementation.
- danudey 13y agoUnless your WriterTo method does something different than the caller assumes it's going to do. Unless the special functions are predefined by the language (e.g. Python's __str__, __len__, __iter__, etc.) or specified in an interface that the class explicitly inherits from, making assumptions that the language developers and I meant the same thing is careless at best and dangerous at worst.