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

    Kirk 10389821 wrote:

    Also, one other commenter mentioned getting older (or more mature), your definition of "knowing" something changes, and gets a lot of depth. When we were kids, writing 2 C++ programs meant we KNEW C++ (ROTFLMAO). Most people came from C, and could write C code in C++... A huge difference, and we "know" that at a deeper level now!

    I think my problem might be a bit of imposter syndrome. Even now I don't think I can code very well in C++, if I'm being honest with myself. I fake my confidence, because I figure maybe I can fake it til I make it. That said, intellectually I know I underestimate myself when I assess my abilities. And most of my C++ code could not be written in C very readily. I use a lot of "advanced" C++ features like metaprogramming.

    To err is human. Fortune favors the monsters.

    K Offline
    K Offline
    Kirk 10389821
    wrote on last edited by
    #38

    (I think you meant C vs. C++ in that last sentence in the 2nd reference of the 3). Wow, honesty in assessing your abilities. That's awesome! So, push through it. You will pick it up. At the end of the day, you will either make it run correctly, or you will fix it. Support that confidence. For me, having over 40 programming languages (with over 5 variations of BASIC, 3-4 assembly) under my belt. I know the KEY Skill is to solve the right problem first. The choice of language after that is syntactical. Most people fail to properly solve the problem. Or shoehorn it into a construct they understand. Language portion is well after I have solved the bigger problem. (And yes, sometimes the constructs used in the language and framework chosen are part of the problem, LOL) Thanks for sharing... I enjoy the things you bring to the surface!

    1 Reply Last reply
    0
    • B BryanFazekas

      trønderen wrote:

      Yes we did ... but they were different languages, not just minor variations of C!

      You raise a good point, although my POV is a bit different. I learned 2 of the languages you mentioned for individual contracts, and never had a reason to learn any of the others. In the business consulting world I lived in, only a handful of mainstream languages had any market share. As a consultant, I focused on languages that I could use professionally.

      trønderen wrote:

      As a way to exert power, to control as much as possible of the software development process, bringing it into the Python ecosystem.

      That is an excellent point! I worked briefly in Object/1, which IIRC was billed as "Smalltalk with C syntax". I realized it was going no where and shifted roles to a C segment of the project. A few years later the customer had to completely rewrite the application from scratch, as support for that version of Object/1 was dropped.

      T Offline
      T Offline
      tronderen
      wrote on last edited by
      #39

      I guess I learned most of the off-mainstream languages - such as APL, Snobol, Prolog - as a student; I didn't have to worry about professional use. Actually, I never used any of those three professionally, ever. None of the languages I have been required to learn as a professional has been anywhere close to 'exciting', considered as language designs. 'As a student' does not necessarily mean 'taking a course at the University'. Snobol I picked up for one single reason: On the network (before Internet - a network named MECC) we had access to at high school, I accidentally bumped into a version of Eliza (the therapist) - a rather primitive variant, but it was written in just 200 lines of Snobol source code. I was so impressed that I had to get to know that language! APL I learned in high school, too: I made friends with a guy whose father worked at IBM, having been on the 5100 design team (Wikipedia: IBM 5100[^]). He was so proud of his father's work that he insisted I learned to program that machine! I did, and was fascinated by APL. Prolog was a balloon ready to burst in my study days. It did, but not until I had completed a Prolog course. Nothing ever became of Prolog or the entire 5th generation project. I never programmed in Occam at all, but we studied it in one course at the university. I guess students of today also dive into a lot of stuff that they will never be using professionally. Maybe today they study all sorts of AI methods? I don't know. But I enjoyed being a student in the years when language design was hot and exciting.

      B 1 Reply Last reply
      0
      • T tronderen

        I guess I learned most of the off-mainstream languages - such as APL, Snobol, Prolog - as a student; I didn't have to worry about professional use. Actually, I never used any of those three professionally, ever. None of the languages I have been required to learn as a professional has been anywhere close to 'exciting', considered as language designs. 'As a student' does not necessarily mean 'taking a course at the University'. Snobol I picked up for one single reason: On the network (before Internet - a network named MECC) we had access to at high school, I accidentally bumped into a version of Eliza (the therapist) - a rather primitive variant, but it was written in just 200 lines of Snobol source code. I was so impressed that I had to get to know that language! APL I learned in high school, too: I made friends with a guy whose father worked at IBM, having been on the 5100 design team (Wikipedia: IBM 5100[^]). He was so proud of his father's work that he insisted I learned to program that machine! I did, and was fascinated by APL. Prolog was a balloon ready to burst in my study days. It did, but not until I had completed a Prolog course. Nothing ever became of Prolog or the entire 5th generation project. I never programmed in Occam at all, but we studied it in one course at the university. I guess students of today also dive into a lot of stuff that they will never be using professionally. Maybe today they study all sorts of AI methods? I don't know. But I enjoyed being a student in the years when language design was hot and exciting.

        B Offline
        B Offline
        BryanFazekas
        wrote on last edited by
        #40

        trønderen wrote:

        I guess I learned most of the off-mainstream languages - such as APL, Snobol, Prolog - as a student

        Same here. I learned 6 or 7 languages during my studies, ones never looked at again. Personally, I believe CS students should be taught a range of languages they might never touch again, as it provides a breadth of understand that makes future learning easier.

        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.

          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