Prior experience and preferred style of programming can affect severely the difficulty of learning Rust. For me it was mostly 1 week of struggling a bit with the borrow-checker and even that only in places where I really wanted to avoid copies / allocations at all cost - achieving something I wouldn't be able to do at all in other languages. Later I realized that if you are ok with an occasional clone here and there, the borrow checker almost never stands in the way. And realizing I can move owned stuff around cheaply instead of copying/referencing was also another huge enabler.
However I can imagine when Rust borrowing rules can be a huge pain. This happens when you expect to continue using the same style of programming that relies on big piles of (often cyclic) object graphs built with references/pointers, shared mutability, heavy (runtime) indirection and inheritance. A style that is so prevalent in OOP projects written in Java, JS, Python. I don't like this style at all, and always tried to avoid it even when coding in those languages, because I believe it causes more harm than good. Rust will simply force you to unlearn it. And some people won't need to unlearn much, and some will have to unlearn a lot. Changing habits is always pain.
I think it should be simply considered a different paradigm.
> I think it should be simply considered a different paradigm.
I addressed this above and believe it to be an unconvincing explanation of Rust's difficulty. Many polyglot programmers comfortable with, and experienced in, switching (and learning new) paradigms, still find Rust more difficult than other languages they have learned. In my experience most just give up. I haven't, but neither have I become remotely productive in the language.
Of course my experience is just one person's sample. There isn't much else to go one. But the Rust Foundation clearly agrees with me, given its 2024 roadmap. In our view, Rust is hard to learn and use, more than most languages, and problematically so for many.
How come Rust appears at the top of most loved languages in the SO survey so many years in a row? And doesn't even make into the "most dreaded" list at all (when many simpler languages do make into that list)?
Also, there aren't any other mainstream languages with borrow checker at the moment. The problem with Rust is that it introduces many novel ideas, not just some old ideas wrapped in a different syntax (e.g. like Kotlin or Swift). They need time to get into developers heads. Similarly it took many years to accept some ideas from FP into mainstream languages, and people were even debating if Java needed lambdas.
And BTW: I didn't find Rust harder to learn than, e.g. Python or Scala... Scala was kinda fun, but FP required similar amount of mind-bending as lifetimes in Rust, and Python was just purely frustrating.
However often you inform someone that they are wrong about what they found difficult, it will not thusly become true. Your brutish & obdurate insistence is only boring.
The difference between what you and I are claiming isn't in the substantive content, it's that you, Shiny Happy Rust Person-style (exemplifying what many of us find so ugly and bullying about the much-vaunted "Rust community") insist on universalising your personal experience.
I've already told you that novelty is nothing whatsoever to do with why I find Rust difficult. It has few novel concepts, and they are simple enough. Note that I never mentioned the fucking borrow checker. Now fuck off. I've blocked you anyway.
> How come Rust appears at the top of most loved languages in the SO survey so many years in a row? And doesn't even make into the "most dreaded" list at all
Because these two lists are mutually exclusive.
On the survey they ask:
* Do you use X today?
* Do you want to continue to use X in the future?
"Most loved" means "the ratio of yes/yes answers is high", and "most dreaded" means "the ratio of yes/no answers is high."
Rust wins "most loved" because many users say yes/yes, and few say yes/no.
If so few people say yes/no then this means to me that either the difficulty is not really as bad as some people try to paint it here (under assumption people don't want to continue using a language that is frustrating), or that indeed the difficulty level might be high but developers get a lot in return, so it is still worth to pay that price and continue using Rust, which means - maybe it is difficult, but it is still productive.
It is very hard if even possible to objectively assess the difficulty of the language, because difficulty is inherently subjective and depends heavily on prior experience. The fact that there are many people who claim to be more productive in Rust than e.g Python or Java, but at the same time many others that don't share that opinion, IMHO supports my claim this is mostly a matter of a paradigm shift.
Also I noticed many developers somehow don't count the difficulty to fix bugs towards the difficulty of the language. And maybe that's also an explanation why we end up with so vastly different opinions.
However I can imagine when Rust borrowing rules can be a huge pain. This happens when you expect to continue using the same style of programming that relies on big piles of (often cyclic) object graphs built with references/pointers, shared mutability, heavy (runtime) indirection and inheritance. A style that is so prevalent in OOP projects written in Java, JS, Python. I don't like this style at all, and always tried to avoid it even when coding in those languages, because I believe it causes more harm than good. Rust will simply force you to unlearn it. And some people won't need to unlearn much, and some will have to unlearn a lot. Changing habits is always pain.
I think it should be simply considered a different paradigm.