3 ms·
The point is, there cannot exist the same sort of terrible Rust code as the terrible C code he complains about. Because the compiler won't let you do it. With C
by Sharlin 9y ago
The point is, there cannot exist the same sort of terrible Rust code as the terrible C code he complains about. Because the compiler won't let you do it. With C you can write code that you don't understand is bad and broken because the compiler happily obliges and the program may even seem to work fine. With Rust you cannot because you're immediately told that the code is problematic (when it comes to memory safety. Of course there are other ways to write bad unmaintainable Rust code.)
- masklinn 9y agoThere kinda can in the sense that you could just make every function `unsafe`, but that's a bit of a giant blinking red flag.
- internetionals 9y agoAnd even then it will warn in many situations. Unsafe does not suddenly make everything okay, it only allows 3 specific things that are otherwise not allowed.
- masklinn 9y agoYes, but through these it does let you break the language by creating invalid values (and thus trigger wide-ranging UBs).
- deleted 9y ago[deleted]