Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Why am I having such a hard time learning Rust?

Why am I having such a hard time learning Rust?

Scheduled Pinned Locked Moved The Lounge
visual-studiodockerhelpquestionlearning
50 Posts 30 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H honey the codewitch

    I don't know if it's just Rust, or if it's me, but I just can't seem to pick it up. Their container system is strange to me. I guess it would probably help if it had some kind of IDE to manage them. But more than that I try reading the documentation on the language and my eyes start to glaze over and I go into dumb-ss mode. :~ I used to just absorb new programming languages. I think maybe I'm getting old? I read somewhere that our intelligence and mental flexibility peaks in our late 20s? and levels out for awhile before declining, so that concerns me. Part of being able to program well means taking in new information all the time, but I look at even the web these days, I look at Rust, and it's foreign to me. :(

    To err is human. Fortune favors the monsters.

    J Offline
    J Offline
    Joss451
    wrote on last edited by
    #41

    I'm 69.5 and I took on Rust this year. I approached it as a 30+ year C/C++/C# programmer. It does have quite the learning curve. Repetition was vital for me in my journey. I watched endless YouTube videos by different creators on a single aspect of Rust, say "borrowing," to understand it. I also used Manning courses for some. Some creators are better than others, of course. "Let's Get Rusty" on YouTube was my go-to for learning the rust-lang book in a structured fashion. Slowly, it jelled. Five months in, I can use the language, but I'm nowhere near an expert. The r/rust community on Reddit has also been great for helping me get unstuck from some of the idioms of the language. It was a lot of hours, but thinking back, learning C was as difficult. I'm glad I invested the time and suffered through the difficulties. It's a splendid language.

    1 Reply Last reply
    0
    • H honey the codewitch

      I don't know if it's just Rust, or if it's me, but I just can't seem to pick it up. Their container system is strange to me. I guess it would probably help if it had some kind of IDE to manage them. But more than that I try reading the documentation on the language and my eyes start to glaze over and I go into dumb-ss mode. :~ I used to just absorb new programming languages. I think maybe I'm getting old? I read somewhere that our intelligence and mental flexibility peaks in our late 20s? and levels out for awhile before declining, so that concerns me. Part of being able to program well means taking in new information all the time, but I look at even the web these days, I look at Rust, and it's foreign to me. :(

      To err is human. Fortune favors the monsters.

      D Offline
      D Offline
      dwight10000
      wrote on last edited by
      #42

      Sounds like me. Retired C++ developer, but I like to keep fiddling with code. Gave up on Rust (too hard) and have focused on Go for (windows) stuff and PHP for web stuff. I like Go because of the nice ecosystem, c-style syntax, and cool concurrency.

      1 Reply Last reply
      0
      • H honey the codewitch

        I don't know if it's just Rust, or if it's me, but I just can't seem to pick it up. Their container system is strange to me. I guess it would probably help if it had some kind of IDE to manage them. But more than that I try reading the documentation on the language and my eyes start to glaze over and I go into dumb-ss mode. :~ I used to just absorb new programming languages. I think maybe I'm getting old? I read somewhere that our intelligence and mental flexibility peaks in our late 20s? and levels out for awhile before declining, so that concerns me. Part of being able to program well means taking in new information all the time, but I look at even the web these days, I look at Rust, and it's foreign to me. :(

        To err is human. Fortune favors the monsters.

        D Offline
        D Offline
        Dweeberly
        wrote on last edited by
        #43

        Rust 'be hard'. Most of the syntax is similar to other languages like c, c++, c#, java, etc... However, most modern languages have been built around hiding and managing memory for you (ex: c#). The thinking is if you don't have to worry about memory management then you can spend more time on the logic. This generally works pretty well. However, Rust was designed to be a "System's language" (i.e. something you could write an OS, or driver or other system component in ... or a web browser, which is basically a self-contained OS these days). While having a familiar syntax, Rust thwacks you in the head and sometimes kicks you in the ...um... "lower mid-section" when it comes to memory management. For years we've been training ourselves to ignore memory management, but Rust put's it front and center in an almost assembly level way. The paradigm is flipped. Get the memory management right and the logic will follow. It's less that you are getting old and more that you've been indoctrinated into ignoring memory management. It's like changing a door that has been 'push' for 20 years to a 'pull' door. Consider your 'container system strangeness'. What are you 'containing'? In Rust you really only have references to memory, and you have to be perpetually aware of the ownership of those references. In C# I can conceptually 'add an object to a List'. I can't really do that in Rust. First no objects, second I can only really transfer ownership or copy memory, sure there's syntax to make it look otherwise, but that veneer of syntax is very thin. ... at least that's been my experience

        H 1 Reply Last reply
        0
        • D Dweeberly

          Rust 'be hard'. Most of the syntax is similar to other languages like c, c++, c#, java, etc... However, most modern languages have been built around hiding and managing memory for you (ex: c#). The thinking is if you don't have to worry about memory management then you can spend more time on the logic. This generally works pretty well. However, Rust was designed to be a "System's language" (i.e. something you could write an OS, or driver or other system component in ... or a web browser, which is basically a self-contained OS these days). While having a familiar syntax, Rust thwacks you in the head and sometimes kicks you in the ...um... "lower mid-section" when it comes to memory management. For years we've been training ourselves to ignore memory management, but Rust put's it front and center in an almost assembly level way. The paradigm is flipped. Get the memory management right and the logic will follow. It's less that you are getting old and more that you've been indoctrinated into ignoring memory management. It's like changing a door that has been 'push' for 20 years to a 'pull' door. Consider your 'container system strangeness'. What are you 'containing'? In Rust you really only have references to memory, and you have to be perpetually aware of the ownership of those references. In C# I can conceptually 'add an object to a List'. I can't really do that in Rust. First no objects, second I can only really transfer ownership or copy memory, sure there's syntax to make it look otherwise, but that veneer of syntax is very thin. ... at least that's been my experience

          H Offline
          H Offline
          honey the codewitch
          wrote on last edited by
          #44

          I primarily code embedded with C++.

          To err is human. Fortune favors the monsters.

          1 Reply Last reply
          0
          • H honey the codewitch

            I don't know if it's just Rust, or if it's me, but I just can't seem to pick it up. Their container system is strange to me. I guess it would probably help if it had some kind of IDE to manage them. But more than that I try reading the documentation on the language and my eyes start to glaze over and I go into dumb-ss mode. :~ I used to just absorb new programming languages. I think maybe I'm getting old? I read somewhere that our intelligence and mental flexibility peaks in our late 20s? and levels out for awhile before declining, so that concerns me. Part of being able to program well means taking in new information all the time, but I look at even the web these days, I look at Rust, and it's foreign to me. :(

            To err is human. Fortune favors the monsters.

            B Offline
            B Offline
            Bertrand Mouton
            wrote on last edited by
            #45

            I do believe it is a function of age, but not in the sense that your brain atrophies, but more in a sense that the older you get the more you realize the relative value of things. I recall when I was much younger, I would do stuff simply because I though it fun or interesting. As I get older I understand that there are tradeoffs. Do I enjoy a You will learn Rust when you have a need to do so. Casually picking up a new language serves no purpose, and interest alone cannot carry the day. There has to be a purpose and intent, then you will learn it, otherwise you will not. I bet that if there was a wicked problem that captures your imagination, and you had to use Rust, you would learn it, and most probably enjoy learning it.

            1 Reply Last reply
            0
            • K Kate X257

              BryanFazekas wrote:

              Everything I see is a retread of earlier stuff in a different package (lipstick on a pig), or it's a monument to ego (see! I made a new language!).

              Yup, pretty much. We've passed the point where we've saturated the field of programming with novel features and languages, somewhere around 2010. Last language I learned out of curiosity was D, and even then I knew it was just a rehash of C with a neat compiler and no viable ecosystem. When looking at Rust, I quite literally see a C variant with thread safety that's specialized for system-level code. I can pick it up in a day, maybe 2 if the toolchain is finicky, but why bother without a concrete project lined up? I doubt it will teach me any great insight I've missed in the last 27 languages I picked up.

              T Offline
              T Offline
              Tim Yen
              wrote on last edited by
              #46

              I have read that it can be a real pain (not that I have coded in Rust) to manage memory because it has memory ownership. That's purely anecdotal by the by.

              1 Reply Last reply
              0
              • H honey the codewitch

                I don't know if it's just Rust, or if it's me, but I just can't seem to pick it up. Their container system is strange to me. I guess it would probably help if it had some kind of IDE to manage them. But more than that I try reading the documentation on the language and my eyes start to glaze over and I go into dumb-ss mode. :~ I used to just absorb new programming languages. I think maybe I'm getting old? I read somewhere that our intelligence and mental flexibility peaks in our late 20s? and levels out for awhile before declining, so that concerns me. Part of being able to program well means taking in new information all the time, but I look at even the web these days, I look at Rust, and it's foreign to me. :(

                To err is human. Fortune favors the monsters.

                S Offline
                S Offline
                Stuart Dootson
                wrote on last edited by
                #47

                Rust does have a number of facets that aren't like the C++ equivalents. I did last year's advent of code in Rust and the main thing I struggled with was how iterators were used - unlike C++, where (before C++20) you use STL algorithms, you chain method invocations, layering iterator transforms. The other things that are unfamiliar are traits (a bit like interfaces), which I knew from Haskell, where they're called type classes, and Rust enums, which are just ['sum types'](https://chadaustin.me/2015/07/sum-types/). Also, everything in Rust is an expression - no statements. Seems weird, but can be very handy (e.g. returning values from `if` or `match` (think `switch`) expressions grows on you, an then you go back to C++ and wonder why you can't do it there...). The memory management (well, lifetime) thing can be a pain, especially if you've got references flying round. But most of the time, you don't see it. I wrote [a little duplicate file finder in Rust](https://github.com/studoot/duplicate-finder), as something to give me experience with it. As for tooling - either [IntelliJ or CLion with Jetbrains Rust plugin](https://www.jetbrains.com/rust/) or VSCode with the [rust-analyzer extension](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer). I use the second one - it gives me pretty much as good a VSCode experience as I get with C++.

                Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                H 1 Reply Last reply
                0
                • S Stuart Dootson

                  Rust does have a number of facets that aren't like the C++ equivalents. I did last year's advent of code in Rust and the main thing I struggled with was how iterators were used - unlike C++, where (before C++20) you use STL algorithms, you chain method invocations, layering iterator transforms. The other things that are unfamiliar are traits (a bit like interfaces), which I knew from Haskell, where they're called type classes, and Rust enums, which are just ['sum types'](https://chadaustin.me/2015/07/sum-types/). Also, everything in Rust is an expression - no statements. Seems weird, but can be very handy (e.g. returning values from `if` or `match` (think `switch`) expressions grows on you, an then you go back to C++ and wonder why you can't do it there...). The memory management (well, lifetime) thing can be a pain, especially if you've got references flying round. But most of the time, you don't see it. I wrote [a little duplicate file finder in Rust](https://github.com/studoot/duplicate-finder), as something to give me experience with it. As for tooling - either [IntelliJ or CLion with Jetbrains Rust plugin](https://www.jetbrains.com/rust/) or VSCode with the [rust-analyzer extension](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer). I use the second one - it gives me pretty much as good a VSCode experience as I get with C++.

                  Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                  H Offline
                  H Offline
                  honey the codewitch
                  wrote on last edited by
                  #48

                  Stuart Dootson wrote:

                  Also, everything in Rust is an expression - no statements

                  Rust is a functional (vs imperative) language? Am I reading you right? Gosh I didn't even realize that.

                  To err is human. Fortune favors the monsters.

                  S 1 Reply Last reply
                  0
                  • H honey the codewitch

                    Stuart Dootson wrote:

                    Also, everything in Rust is an expression - no statements

                    Rust is a functional (vs imperative) language? Am I reading you right? Gosh I didn't even realize that.

                    To err is human. Fortune favors the monsters.

                    S Offline
                    S Offline
                    Stuart Dootson
                    wrote on last edited by
                    #49

                    It has functional aspects, but it's still very much an imperative language. The way that it melds being an expression language with being an imperative one is that the semicolon separates and sequences expressions, much like the comma does in C. What can make it useful, though, is cases like those Rust making bindings immutable by default. For example, in C++, I might write ```C++ int x; switch(some_value) { case 0: x = 15; break; case 2: x = 29; break; default: x = some_function(some_value); break; } ``` I need to declare the variable separately from its initialisation, and then rely on it being mutable to do the initialisation (although I *could* do it all in one with an immediately invoked lambda expression...). In Rust, this becomes: ```Rust let x = match some_value { 0 => 15, 2 => 29, v => some_function(v), // Match any other integer value and bind v to it }; ``` Rust requires all bindings to be initialised, so for complex cases, getting a value out of something like a `match` can be very useful.

                    Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                    1 Reply Last reply
                    0
                    • H honey the codewitch

                      I don't know if it's just Rust, or if it's me, but I just can't seem to pick it up. Their container system is strange to me. I guess it would probably help if it had some kind of IDE to manage them. But more than that I try reading the documentation on the language and my eyes start to glaze over and I go into dumb-ss mode. :~ I used to just absorb new programming languages. I think maybe I'm getting old? I read somewhere that our intelligence and mental flexibility peaks in our late 20s? and levels out for awhile before declining, so that concerns me. Part of being able to program well means taking in new information all the time, but I look at even the web these days, I look at Rust, and it's foreign to me. :(

                      To err is human. Fortune favors the monsters.

                      C Offline
                      C Offline
                      Chad3F
                      wrote on last edited by
                      #50

                      Rust might be best described as taking the traditional coding paradigm and turning it on its head. ... then chucking it into a blender and setting it on puree.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups