Originally posted by Volta
View Post
In C when I look at a function signature I have no idea if the return value or any of its arguments can be null, while in Rust it is apparent from the Option type.
In C a function might return the value -1, if it does that is quite surprising and unexpected, furthermore I don't really know what it means even though I can guess it is some kind of error. In Rust this will never be a surprise as a function will return the Result<T, E> type which tells me there can be an error and gives me an enum to figure out what the problem is.
In Rust the loop will be a simple foreach loop, but in C the index can start on 0 or 1 or something else, and it can be i++, i--, ++i, or --i or something else confusing.
Comment