News for hackers. Stuff that matters.
Re:Rust things I miss in C by Sharlin on Monday February 19, 2018 @09:19AM (#16412994)
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.)
Re:Rust things I miss in C by masklinn on Monday February 19, 2018 @09:27AM (#16413036)
There kinda can in the sense that you could just make every function `unsafe`, but that's a bit of a giant blinking red flag.
Re:Rust things I miss in C by internetionals on Monday February 19, 2018 @09:53AM (#16413169)
And 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.
Re:Rust things I miss in C by masklinn on Monday February 19, 2018 @10:03AM (#16413252)
Yes, but through these it does let you break the language by creating invalid values (and thus trigger wide-ranging UBs).