4 ms·
I really can’t understand where this idea that rust is ‘hard’ comes from. Everything that it formalizes is something that you should already be conscious of.
by jmartin2683 4y ago
I really can’t understand where this idea that rust is ‘hard’ comes from. Everything that it formalizes is something that you should already be conscious of. If not, well… you have a different, bigger problem.
- planetis 4y agoCan you explain to us what's the bigger problem we should be addressing according to your opinion sir?
- jmartin2683 4y agoYou’re creating lots and lots of bugs that will come back to haunt to at runtime (midnight on a Friday if the universe has its way).
- lolinder 4y agoYou're assuming everyone is coming to Rust from C. People who are learning Rust from a garbage-collected language will absolutely feel that Rust is harder than what they're used to, and not because they were writing bug-ridden code in Java or whatever.
- moldavi 4y agoSingle ownership often introduces bugs of its own. In Java, I never need to create an Err if the thing my ID is "pointing" to isn't around anymore in whatever hash map the borrow checker made me store it in. It's good in some cases, bad in others.
- wiseowise 4y ago> In Java, I never need to create an Err if the thing my ID is "pointing" to isn't around anymore in whatever hash map the borrow checker made me store it in. What’s the problem here in Rust?
- wk_end 4y agoThat's true only in comparison to languages with manual memory management. Higher level languages spare you the burden of being conscious about these things, which means Rust is naturally going to be more difficult to work with than, oh, I dunno, Ocaml. From the other direction, coming from low-level languages: the other problem is that Rust's type system isn't powerful enough to express certain things that you, a competent C programmer, might be fully conscious of...and so you end up needing to fight the type system to get it understand something you're already aware of. To use a classic example, you can understand exactly how the lifetimes work in a doubly linked list but still find it more painful to write in Rust than in C.
- jmartin2683 4y agoMemory things, sure. There is the whole concurrency/parallelism thing, though.
- moldavi 4y agoPony is a great example of fearless concurrency without the borrow checker's difficulties.
- fredrikholm 4y agoIt's a shame how seldom this language comes up in discussions, I toyed around with a few years back and it was wonderful even back then. Happy to see that it's getting frequent commits, would love to see it become more popular.
- aussiesnack 4y agoIt's not an 'idea'. Many people find it hard (I do). You might not understand why this is the case, but that they (we) do is an empirical fact.
- afavour 4y agoNot really. Plenty of languages are garbage collected so you don't need to consider the intricacies of memory management. That was one of the biggest issues I found when I first started writing Rust.
- moldavi 4y agoThat absolute claim is simply not true. That's like saying that people need to avoid shared mutability in every program, which simply doesn't make sense for a lot of programs, especially if you have a garbage collector already. It's only a useful tool that has some nice qualities in some settings. It's not some underlying truth of the cosmos, it's just a situationally useful way to do things.