by 0xFFC · 10y ago · 0 comments
respectfully, This is pure nonsense.
First of all rust does not have runtime and AFAIK for providing exception you should have runtime to manage stack.
Second not every language should be like high-level languages, it is not the rule to be like C#,Java,Python,etc. I use a lot of them for my work when I need simple thing to do, but rust designed to do low-level stuff, and I cannot understand how having not having exception makes a language ugly (specially when you code in lowlevel).
Not quite.
1. you're supposed to handle errors around function calls which can fail, which is a strict subset of "every function call"
2. rust has a number of higher-order constructs to facilitate that handling[0][1][2], not just raw `match` statements or expressions.
That aside, for rust explicit error handling is considered a feature both at the language level (allows for less runtime requirements and much stronger guarantees — check out exception-safe C++ for what happens when low-level meets exceptions) and at the user level (by forcing a conscious and explicit decision, whether it's crashing the system, handling the error or passing the ball upwards)
> the code quickly gets bloated, doesn't it?
Does C code quickly get bloated? Because you're also supposed to check for error codes after each function call which can fail, and C doesn't provide much abstractive power to mitigate that.
[0] http://doc.rust-lang.org/std/result/enum.Result.html
You can use convenience functions: expression.expect("panic with this message if expression evaluates to an Err")
You can also use macros: try!(expression) makes it so if expression evaluates to an error it returns the error immediately, otherwise it does nothing.
This approach is still more verbose than using exceptions but on the flip side dealing with errors up front can make it easier to write reliable code.
FWIW I also share their opinion that rust is unapproachable.
Do you have a specific symbol you would like to change in Rust, and what would you like to change it to?
The only example I've seen (in a child comment to yours) is effectively a complaint that Rust has lifetimes and Go doesn't, which is effectively saying "you should have a garbage collector like Go does", which is an argument against a fundamental design decision of Rust. If you want to argue that you should always use a garbage collector, argue that directly instead of making vague negative comparisons between Rust's and Go's syntax.
It's a minor quibble to be sure, but it's the only language symbol that bothers me when writing Rust. Not sure what I'd suggest replacing it with...backtick, maybe? Pipe? @? ~?
There aren't many other special characters on a QWERTY board that aren't already used in Rust. Which I think gets at one of the stumbling blocks that I see in the various Rust syntax bikesheds among those who haven't worked in the language. It's just alien until you've used it a bit, especially if you're writing a lot in pseudocode-y dynamic languages.
* For heap and owner pointers respectively.
That's an argument against introducing new notation for anything. That can't be right.
> static NAME: &'static str = "du";