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

The thing is, although the check looks like work, a correct C++ solution almost always needs to do the same work. There are real world cases where it doesn't, but lots more where in C++ we need to explicitly do the work or our program malfunctions, sometimes in subtle ways - while in Rust we get this right by default.


There are cases where you as the programmer have enough to know that there is data in the container even though anything less than whole program analysis cannot prove it. Rust will do unneeded check in those cases.

I do agree though, the cost of the check is so small that it doesn't matter in most cases.




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

Search: