An average programmer's (me) reason to invest in Rust

  • The first three paragraphs: experienced engineer, knows a few languages, still finds Rust daunting after two years, has tried to and stopped learning multiple times.

    All of that for the upside of being able to look under the hood, being forced to think about data first, and the great tooling.

    The effort vs. reward here is why most companies will stick to something much simpler and why Rust, for almost any given problem, there is most likely a "better" language for the job, and even where Rust shines, there will remain a more popular language for the job for some time to come.

    You really have to smoke whatever quality herb they're smoking to get into it, because the rewards will take a while, if ever.

  • You should learn Rust if you want to write fast code.

    There’s a discussion on lobsters “C++ or Rust?” (https://lobste.rs/s/0akqy7/are_there_any_good_reasons_use_c_...) and the general consensus is that Rust is better except for legacy reasons. I disagree, I believe there are niche cases C++ is better even on new projects with new teams (maximum performance, no care about safety, most on the team don’t care about “functional programming”, something like UI or game dev), but they are niche and the benefit is marginal. Which means Rust has a good chance to become the future.

    Even if you end up writing C++, Rust teaches concepts which translate to C++ specifically and writing fast code in general. Including concepts related to the “functional” aspect which will help you write better, safer C++.

    Also learn Rust if you want to learn more about low-level abstractions and functional programming, primarily for writing fast code.

    However, I still believe you shouldn’t learn and use Rust for writing general-purpose code, unless you care about learning performance. Because languages with garbage collectors (JVM languages) and weaker memory models (Swift) are “fast enough” in most cases. And I’m very skeptical that most people would implement something faster in Rust than they would in Kotlin, TypeScript, OCaml, even C# or Java; because the borrow checker does create overhead. Unless they need to go back and optimize for performance (or they are writing idiomatic code in Rust but not in the other languages; most of the functional paradigms from Rust, like small structures, typed wrappers, polymorphism, composition, even ad-hoc multiple inheritance (extensions or default methods) and pattern-matching can be applied to all the languages mentioned above).