(no title)
iagooar | 3 months ago
Of course, I am exaggerating a bit - and I am not even that experienced with Rust.
But after coding with Ruby, JS/TS and Python - it feels refreshing to know that as long as your code compiles, it probably is 80-90% there.
And it is fast, too.
imron|3 months ago
All that fighting with the compiler is just fixing runtime bugs you didn’t realize were there.
echelon|3 months ago
I'd wager my production Rust code has 100x fewer errors than comparable Javascript, Python, or even Java code.
The way Result<T,E>, Option<T>, match, if let, `?`, and the rest of the error handling and type system operate, it's very difficult to write incorrect code.
The language's design objective was to make it hard to write bugs. I'd say it succeeded with flying colors.
rascul|3 months ago
I found that at some point, the rust way kinda took over in my head, and I stopped fighting with the compiler and started working with the compiler.
apitman|3 months ago
ikety|3 months ago
josephg|3 months ago
I’ve made this mistake in TS more times than I’d like to admit. It gives rise to some bugs that are very tricky to track down. The obvious ways to avoid this bug are by making everything deeply immutable. Or by cloning instead of sharing. Both of these options aren’t well supported by the language. And they can both be very expensive from a performance pov. I don’t want to pay that cost when it’s not necessary.
Typescript is pretty good. But it’s very normal for a TS program to type check but still contain bugs. In my experience, far fewer bugs slip past the rust compiler.
regular_trash|3 months ago
Also, many built in functions do not have sufficient typesafey like Object.entries() for instance
o11c|3 months ago
unknown|3 months ago
[deleted]