Most active commenters

    ←back to thread

    452 points birdculture | 11 comments | | HN request time: 1.137s | source | bottom
    1. woah ◴[] No.43979099[source]
    Does anyone still have trouble learning Rust? I thought that was kind of a 2015 thing
    replies(6): >>43979158 #>>43979518 #>>43980144 #>>43980244 #>>43981227 #>>43985955 #
    2. mre ◴[] No.43979158[source]
    The thing is, once you internalized the concepts (ownership, borrowing, lifetimes), it's very hard to remember what made it difficult in the first place. It's "curse of knowledge" in some sense.

    What's changed since 2015 is that we ironed out some of the wrinkles in the language (non-lexical lifetimes, async) but the fundamental mental model shift required to think in terms of ownership is still a hurdle that trips up newcomers.

    replies(1): >>43979201 #
    3. echelon ◴[] No.43979201[source]
    100%. Newcomers still struggle a bit, especially if they've never used C/C++ before.

    A good way to get people comfortable with the semantics of the language before the borrow checker is to encourage them to clone() strings and structs for a bit, even if the resulting code is not performant.

    Once they dip their toes into threading and async, Arc<Lock<T>> is their friend, and interior mutability gives them some fun distractions while they absorb the more difficult concepts.

    replies(1): >>43979267 #
    4. mre ◴[] No.43979267{3}[source]
    Do you mean `Arc<Mutex<T>>`? Yeah, I agree. Wrote a blog post on that topic as well: https://corrode.dev/blog/prototyping/ The title is a bit of a misnomer, but it's about beginner-friendly escape hatches in the language. Perhaps it's useful to newcomers.
    replies(1): >>43979708 #
    5. SoftTalker ◴[] No.43979518[source]
    For me it was like Haskell. I spent an afternoon on it, my brain hurt too much, and I relegated it to the category of languages that are too complicated for what I need to do with a computer.

    Languages I liked, I liked immediately. I didn’t need to climb a mountain first.

    6. echelon ◴[] No.43979708{4}[source]
    Any lock, but that's generally the best choice.

    Great post! It's got a ton of advice for being productive, and it should be especially useful for beginners.

    7. LAC-Tech ◴[] No.43980144[source]
    Yeah I struggled with it.
    8. whobre ◴[] No.43980244[source]
    Coming from C++, I don’t find it hard to learn. I do find it annoying, don’t love the syntax and absolutely hate cargo.

    To each his own, I guess….

    9. lenkite ◴[] No.43981227[source]
    Unfortunately, yes. I still end up writing C++ instead of Rust for low-level system stuff. Since I also know Go - I usually prefer that when I need lean, middleware services. Learned Rust (somewhat) with great difficulty but still don't use it anywhere. Still haven't figured out how to design effectively using Rust and approaches suggested in that article like clone()/unwrap() stuff and refactor later just leave a bad taste in that mouth.
    10. devnullbrain ◴[] No.43985955[source]
    It's very flattering! It's perhaps the only time in internet computing circles where I repeatedly see people argue in a way that boils down to:

    'I'm not as good as learning things at you'

    replies(1): >>43987368 #
    11. fsckboy ◴[] No.43987368[source]
    >'I'm not as good as learning things at you'

    some of my cs professors in school were really good at learning things at me, but haskell and rust professors are not generally as good at it as that.