TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

33 点作者 brainless大约 1 年前

2 条评论

givemeethekeys大约 1 年前
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.<p>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.<p>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 &quot;better&quot; language for the job, and even where Rust shines, there will remain a more popular language for the job for some time to come.<p>You really have to smoke whatever quality herb they&#x27;re smoking to get into it, because the rewards will take a while, if ever.
评论 #39400128 未加载
评论 #39407790 未加载
评论 #39401033 未加载
armchairhacker大约 1 年前
You should learn Rust if you want to write fast code.<p>There’s a discussion on lobsters “C++ or Rust?” (<a href="https:&#x2F;&#x2F;lobste.rs&#x2F;s&#x2F;0akqy7&#x2F;are_there_any_good_reasons_use_c_over_rust" rel="nofollow">https:&#x2F;&#x2F;lobste.rs&#x2F;s&#x2F;0akqy7&#x2F;are_there_any_good_reasons_use_c_...</a>) 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.<p>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 <i>better, safer</i> C++.<p>Also learn Rust if you want to learn more about low-level abstractions and functional programming, primarily for writing fast code.<p>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).
评论 #39400728 未加载
评论 #39414360 未加载