4 ms·
I’m not sure how much Rust code you’ve actually written, but almost uniformly everyone in the Rust community prefers ? to try! and the explicit designating that
by Ar-Curunir 7y ago
I’m not sure how much Rust code you’ve actually written, but almost uniformly everyone in the Rust community prefers ? to try! and the explicit designating that you suggest. The fact that other languages are adopting this [1] suggests that your preference is not the popular one.
And I’m pretty sure there isn’t “continuous energy” being invested in supporting this. It’s primarily a one and done feature...
[1] See for example https://news.ycombinator.com/item?id=20804247 https://news.ycombinator.com/item?id=20804247
- dgb23 7y agoI made it very clear that this is my personal opinion. I'm aware of the fact that the feature made it into the language, because it had widespread support. I still don't think it is a good feature. > I’m not sure how much Rust code you’ve actually written Only as much as someone who finds time on the side to learn the language. There are many things that make this process nice, for example the compiler messages, clippy, traits, the functional API on iterators and so on. But I've read substantially more code than I wrote. And as I stated the ? operator seems to be primarily a feature that makes writing more convenient. Not easier, not clearer, just shorter. The pattern matching syntax expresses what it does very clearly and explicitly in a nice, tree branching like structure. And it is also documenting the code more directly. Again, even if you and "almost uniformly everyone" disagrees with this. There is still the more general point of: How useful does a feature need to be to be considered at all? "Most people find it nicer to write" is in my opinion too weak. > And I’m pretty sure there isn’t “continuous energy” being invested in supporting this. It’s primarily a one and done feature... To be frank I find this to be shortsighted. Every syntactic feature adds baggage, that has to be dealt with continuously on some level. The feature already was limiting the syntactic possibilities of async/await for example, which is in my opinion a much more important and impactful feature. This is the kind of evolution that is painful to see, especially since this is a repeating pattern with evolving languages. I like, even admire a lot of things about the language but I feel the weak point of Rust is its syntax. Especially for such a young language there are already too many ways to express the same thing. And this might be the fundamental point where we disagree.