5 ms·
I can see why people don't like to write Rust. It is more tedious, harder because of the ownership model, and has a very steep learning curve. What I don't get
by lblume 1y ago
I can see why people don't like to write Rust. It is more tedious, harder because of the ownership model, and has a very steep learning curve.
What I don't get is what people have against programs written in Rust from the bottom up. They are safer to use, introduce far fewer vulnerabilities, and you can even locally reason about the code much better than in typical 'unsafe' languages like C++.
- teddyh 1y agoThe non-stable ABI, forcing all-statically linked binaries, is also a thing.
- tadfisher 1y agoWhich has next to zero impact on Windows applications, which ship their own DLLs anyway (besides stuff like DirectX).
- eikenberry 1y agoIt seems like your first paragraph answers the question in the second. If it is harder to use and learn then that reduces the value of free software released using it as that software is then harder to modify, fix, contribute to, etc. The tradeoff for Rust being hard should be more security and fewer bugs. The additional cost here, and the one that the OP is probably annoyed with, is that it moves away from the languages/platforms that MS has traditionally used and that developers who work on that platform expect.
- koakuma-chan 1y agoIs Rust harder than C++?
- npalli 1y agoYes.
- Guekka 1y agoThat answer lacks some nuance Yes, it is harder to get a Rust program to compile. But it also is easier to accomplish the desired task safely
- eikenberry 1y agoIf the OP already knows C++ then it would obviously be harder for them. Given the nature of their post, this was my interpretation.
- haiku2077 1y agoIt's harder to do simple things and easier to do complicated things.
- amenhotep 1y agoNo.
- 90s_dev 1y ago> and you can even locally reason about the code much better than in typical 'unsafe' languages like C++. Do you have an example of this? I'm just a TypeScript guy who never had a fair chance to use C++ or Rust for long, so I'd be curious how what you say is true.
- lblume 1y agoOne of the strongest example for me is newtypes. I strongly believe in Parse, don't validate (https://news.ycombinator.com/item?id=21476261 https://news.ycombinator.com/item?id=21476261) and think Rust's newtype pattern is able to really enforce this strongly. When writing a Rust program, I can often basically express it as a single value (the input) being sequentially converted in type. The typestates, if you choose this name, allow great compile-time verification of most desired properties. You are really forced to describe the way the core logic flows in a modular way. However this is just one and likely not even the most prominent aspect making Rust so great. Local reasoning also becomes easier via explicit opt-in mutability, and function signatures always being the only relevant source of truth when regarding their compile-time evaluatability (especially compared to C++ templates). No accessing uninitialized memory, a very simple implied notion of a constructor as merely a method without a self parameter, soundness of all received types, likely much more...