• 1 Post
  • 14 Comments
Joined 1 year ago
cake
Cake day: July 24th, 2023

help-circle







  • Rust has exactly the same problems with depreciation as many Frameworks rely on experimental features which are subject to change.

    Rust has actually quite a good record with depreciation and backwards-compatibilty etc. They are changing the language in non-backwards compatible way over editions, but the changes are mostly very manageable.

    But to not end up being another C++ (syntax-wise it’s a disaster IMHO), a few non-backwards-compatible changes every few years are the way to go, when it’s manageable.


  • Learning curve is steep in the beginning, I agree (I wouldn’t argue painful though, maybe if you have to unlearn bad practices, like interior mutability though etc.).

    But I think it pays off after some time. I’m now faster in Rust than in C# with similar experience, and the quality of the code is definitely higher as well (which can be credited to the strict kinda opinionated design of Rust IMO).

    It composes really well, better than most (non-functional) popular languages. I think this is probably the Sell for Rust, as it additionally works remarkably well over the entire stack (kernel -> frontend) (in each abstraction level might be better/easier to use languages to be fair though).



  • I’m not speaking for Rust level performance. I’m using Rust nowadays, because it’s generally doing a lot right, that other popular languages struggle with IMO.

    Think about error handling. I think even Java is better here than C#. I think it’s quite a mistake, not being required to add all possible exception types that a function can throw to the function signature.

    Then the next thing, I really hate about almost every popular language is implicit null. To be really safe, you have to check every (non-primitive) variable for null before using it, otherwise you have a potential NullPointerException.

    Then take pattern matching, this is a baked in feature of Rust from the beginning and it does this really well (exhaustive matching etc.). There’s “basic” pattern matching in C#, but it just doesn’t really feel right in the language, and is not even close in capability compared to Rusts.

    All of this (and more) makes Rust the less error-prone language, which I can say with confidence after long experience with both of these languages (both > 5 years).

    I’m honestly not sure why exactly C# was chosen for most of the games, but it’s probably because it’s relatively good to embed, is relatively strong-typed, while being somewhat performant (compared to something like python or other scripting languages).