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

OP says you can't really avoid it in Rust either, but argues that because there's not a separate check it's more robust. I agree w/ you though that it's not a strong argument, and that you can do the same thing in C++; it's a confusing/arguably incorrect point IMO.

More broadly, this is kind of a bad example. Handling files is surprisingly difficult and that's really where the dragons lie here. IME the dragons exist for both Rust and C++, because they're platform problems rather than stdlib/language problems.

NB: the correct thing to do here for POSIX platforms is to call fstat, which is true regardless of systems language.



I found the filesystems complaint about C++ bizarre too, because that is a system-dependent behaviour. How an open file behaves when it is deleted has very little to do with the programming language. And it does not matter if that language is Python, Rust or C++. These ecosystems interact with the underlying OS and report back what the OS layer tells them.

I absolutely understand some of the niceness about Rust preventing programmers from shooting themselves in the foot(it is still possible nonetheless), but sometimes it feels people just want to complain about C++ for the sake of complaining.




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

Search: