Why am I having such a hard time learning Rust?
-
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.
-
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.
Kate-X257 wrote:
I doubt it will teach me any great insight I've missed in the last 27 languages I picked up.
I know what you mean. :laugh: During the first 10 years of my career (started late 80's), on average I learned a new language, tool, library, or package every 3 months. This includes version changes where the differences required study and/or effort. A large part of that was being a consultant/contractor, so I learned whatever the new client needed. Now? Companies and organizations pump out new versions in an attempt to stay relevant, and force churn by dropping support for "old" versions, after periods as short as 12 - 18 months.
-
BryanFazekas wrote:
We didn't have the plethora of languages we do today
Yes we did ... but they were different languages, not just minor variations of C! Think of APL, with it workspace concept and free floating matrices and functions. Think of Snobol, with its predicate matching integrated into an algorithmic programming language. Think of Lisp, and its very data structured (list) oriented design. Think of Prolog, the predicate language that was expected to take over the world through the '5th generation project'. Think of purely functional languages such as Erlang. Think of highly parallel languages such as Occam. Think of event oriented languages such as CHILL. Languages where different and exciting. Who cares about yet another minor change to C syntax? Besides: The majority of language developments today certainly are not done to provide you with a better language, but to lure you into some different infrastructure, software ecology, environment, ... Once you have entered it, you are locked into it. The development you do in, say, Python (randomly chosen example!), cannot easily be utilized by other developers unless they as well move into the Python sphere. Which is the exact reason for the Python ecology being designed the way it is: As a way to exert power, to control as much as possible of the software development process, bringing it into the Python ecosystem. That seems to be its basic purpose: There is no real reason why Python should not be just another algorithmic language alongside with all the old ones. Sure, there are modern variants of most 'non-c-derived' languages, but who cares about them today? In language discussions, their only purpose seems to be to make old farts (like me) shut up. In all respects, they are irrelevant. So: New languages of today, yet another variation of c syntax, are plainly boring! Who would care to study them?
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.
-
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.
For me, I learn new languages by reading as much source code as I can. This allows my brain to pickup the constructs/flows pretty quickly. This works really well... UNTIL you get to heavily "decorated" languages. .NET web code shocked my system. Then some of it is about the language helping to change programming detail location. I have some old code in my favorite language, where I was practicing some of this. It's really cool. Everything is based on a base class that knows how to "process" something. Then I inherited from that with 2-3 implementations based on filetypes, expectations. One master controller loop that dealt with setting orders. Every process was nice and tight/small. To this day, it's the hardest code for me to modify. I have re-immerse myself in the code. Unfortunately, I don't know RUST but my initial take is that the language contains a paradigm shift. Either in Decorations for some level of control, or conceptually to organize the code. (If that makes sense). Once you wrap your arms around it (like the transition to C++, which was BRUTAL because of all of these Object Rules), things will likely fall in place. But I still think it's easiest to start by reading someone elses code. And modify it! Get dirty. 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!
-
For me, I learn new languages by reading as much source code as I can. This allows my brain to pickup the constructs/flows pretty quickly. This works really well... UNTIL you get to heavily "decorated" languages. .NET web code shocked my system. Then some of it is about the language helping to change programming detail location. I have some old code in my favorite language, where I was practicing some of this. It's really cool. Everything is based on a base class that knows how to "process" something. Then I inherited from that with 2-3 implementations based on filetypes, expectations. One master controller loop that dealt with setting orders. Every process was nice and tight/small. To this day, it's the hardest code for me to modify. I have re-immerse myself in the code. Unfortunately, I don't know RUST but my initial take is that the language contains a paradigm shift. Either in Decorations for some level of control, or conceptually to organize the code. (If that makes sense). Once you wrap your arms around it (like the transition to C++, which was BRUTAL because of all of these Object Rules), things will likely fall in place. But I still think it's easiest to start by reading someone elses code. And modify it! Get dirty. 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!
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.
-
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.
(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!
-
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.
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.
-
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.
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.
-
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.
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.
-
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.
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.
-
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.
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
-
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
I primarily code embedded with C++.
To err is human. Fortune favors the monsters.
-
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.
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.
-
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.
-
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.
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
-
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
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.
-
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.
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
-
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.