Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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].

[1] https://www.youtube.com/watch?v=YQs6IC-vgmo


Yeah. Although dynamic arrays would need that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: