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

I mean, by that measure C/C++ and many others have the same problems. Your issue about lack of compiler-enforced reuse checks after invalidation is more with the language than this feature. While I agree generally, I don't see how slices are any more of a problem or surprising here than any other mutable reference that may or may not be mutated conditionally by a function.


> I mean, by that measure C/C++ and many others have the same problems.

No. C only has raw pointers so it's not trying to pretend slices are vectors, and C++ has actual functioning vectors with "slicing" being either a copy of the subvector or an iterator. Either way there is no confusion as to the capabilities of what you're given and its relation to the original data.




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

Search: