Re:The future of C# and Visual Basic [video]
by ickoonite on Monday November 03, 2014 @02:42PM
(#8552964)
Arrays actually do implement IList<T>; they did think of that. I guess the problem is that it's not discoverable. I'd second your call for an interface on numbers (including some way to "genericise" TryParse).
[ Parent
| on HN ]
Re:The future of C# and Visual Basic [video]
by cema on Monday November 03, 2014 @03:36PM
(#8553312)
I guess the problem is that it's not discoverable.
I think you are absolutely right. While the reflection is available (and the documentation, in general, is not at all bad), discoverability is still weak.
Re:The future of C# and Visual Basic [video]
by sparkie on Monday November 03, 2014 @03:21PM
(#8553220)
Arrays implementing IList<T> is a clear example of a broken abstraction though - arrays have no need for Add, Remove and whatnot that come with IList - it only needs indexing and count.
Re:The future of C# and Visual Basic [video]
by noblethrasher on Monday November 03, 2014 @04:04PM
(#8553483)
We normally think of Strings as being a special case of an array, but arguably String<T> should be a fundamental datatype, and we could do away with Array altogether. In that case, having operators for add and remove doesn't seem so crazy, especially in light of the fact that vectors often outperform doubly linked list for insertion and deletion on modern hardware[1].