5 ms·
Am I a bad programmer if rust is really difficult for me. I desperately want to learn a low-level language, since I think I'm missing something hanging out with
by 999900000999 2y ago
Am I a bad programmer if rust is really difficult for me. I desperately want to learn a low-level language, since I think I'm missing something hanging out with my buddies C#, Python and NodeJS.
C and C++ are too difficult, Rust is also hard. I think my best bet is Zig at this point.
- knowitnone 2y agoWhy is Zig easier than C/C++/Rust?
- coaksford 2y agoNo, Rust gives you a lot to wrap your head around very quickly, and it took me three or four epiphanies to get it, and I tried to learn and stopped twice before I was able to get far enough along with it that it became easy to think about and work with. It doesn't make you bad programmer, but I'd still suggest giving it another shot every 6 months or so as your time allows, and see if you're getting farther each time. As long as you're still learning each time you bounce off of it, it was probably time well spent, most Rust concepts will show up in other languages, and the ones that won't are still useful paradigms to be aware of so you can contrast it with other paradigms as you get more experience with those.
- 999900000999 2y agoI think where I'm getting stuck, is my favorite programming language C# tends to make a bunch of safe assumptions for you. These assumptions just aren't made with rust.
- api 2y agoRust has a steep initial learning curve followed by a plateau of enlightenment. The language has a lot of corners though -- not so much messy edge cases like C++ but just emergent complexity from its sophisticated grammar and type system. As with all such languages: you do not have to make use of all language features everywhere, and in fact you should not.
- zozbot234 2y agoRust is very different from Python or C#, let alone NodeJS. I'm not sure what exactly is so difficult about Rust for you, but the basic feature-set of Rust as "your first programming language" (i.e. no prior experience with C/C++) is one where the main emphasis to begin with should be on passing stuff by value and explicit copying, almost like a functional language - avoiding both references and interior mutability. These latter features should be looked into after you've become familiar with the basics, so as to avoid any confusion.
- throwaway314155 2y agoSurely the reason the learning curve is hard has more to do with syntax than with grokking basic FP concepts such as immutability. Right?
- HKH2 2y agoI'd say lifetimes give the most cryptic errors to beginners.
- estebank 2y agoIf you encounter specific diagnostics that are cryptic, file tickets. A lot of things were aware of and we improve them regularly, faster when easy, slower when complex, but we eventually get to them. We can't fix cases we haven't been made aware of, so reports from the field are very useful (sometimes users are more creative when it comes to misusing Rust than even fuzzers are).
- WalterBright 2y agoThe D programming language is far safer than C/C++, with the same amount of power. The syntax/semantics are such that it's very easy to learn if one is familiar with C/C++. For example, although one can use pointers in D with abandon, it's better to use slices, where array bounds overflows cannot happen. Array bounds overflows are the #1 cause of security bugs in shipped C/C++ software.
- throwaway314155 2y ago> if one is familiar with C/C++. > C and C++ are too difficult
- 999900000999 2y agoI think we might have chatted here before. I want to like D, it definitely came up in my research but I just don't see the ecosystem as vibrant enough to lead to where I want it to . Either building cool things, or better employment opportunities. It is encouraging to see a language so loved folks are proselytizing for it. My vote is for Haxe! But that's also a very high level language.
- WalterBright 2y agoThe people who do use D really like it. It's a mature language with solid compilers. I haven't experienced a memory corruption problem with it in maybe a decade, and I write D code every day. That's a big change from my days writing C and C++.
- WD-42 2y agoNo, Rust is definitely hard. One of the best memes I’ve seen about rust goes like “Other languages have a garbage collector, with Rust you are the garbage collector.” I also haven’t had as much fun learning another language in a long time. Keep with it! It’s worth it.
- switchbak 2y agoC is small enough as to be very valuable to know. It's not the "high level assembler" that it was originally sold as, but as a conceptual model it's invaluable. It's also very valuable to run through CVEs, bug reports and such to find out how it falls down, and why safer languages have value. You can learn all that without even learning it to such a degree that you can write code in it. I know you said C seems too hard - I felt the same way some 30 years ago. Then I learned Pascal, and found learning Ada to be a bit of a breeze after that. After that, coming back to C was a different experience - very natural. You don't have to force anything, and you can learn whatever you want whenever you want (or not at all). Sometimes your capabilities can quickly level up in unpredictable and exciting ways - which I find to be one of the most fun parts of programming. And it tends to unfold like a horizon - you learn low-level stuff, then you get interested in high-reliability software, or real-time systems, or highly parallel / functional systems, etc. This is all great, and no one brain is big enough to hold it all - so have fun!
- the8472 2y agoIf you have written multithreaded C# code which encountered deadlocks, race conditions and had to build a mental model of which thread is responsible for what and currently "owns" a resource and is allowed to modify them... then you already kind of know a bunch of things implicitly that rust makes explicit and can transfer that knowledge. At least that's how things clicked for me when I came from Java and I already had to debug lots of concurrent code before. Similarly, if one has fought with a garbage collector and thought about efficient memory representations, where things get allocated and deallocated that transfers to some extent. If you have been living blissfully in effectively-single-thread-land, then yeah, there'll be a bunch of new concepts to digest.
- 999900000999 2y agoAt least for the work I typically do, including my hobbyist projects in Unity, I almost never have to use threads. Praise be to Async, which has abstracted a lot of this. I couldn't really grass programming until I found JavaScript. Even now my criteria for learning a language is one of two things . One, do I want to build something and this language would be the best tool . Or, two, is this language going to make me a ton of money. I really want to find a good use case for Rust that isn't superseded by what I can do in the languages I already know. I might take some time to make a game in Rust one day...
- zozbot234 2y ago> Or, two, is this language going to make me a ton of money. I don't think any language per se is ever going to make you a ton of money. Even COBOL is not enough to make a ton of money. What might make you a ton of money at some point is being highly skilled at developing in some broad area where that particular language happens to be used. > I couldn't really grass programming until I found JavaScript. This is a bit surprising to me, because JavaScript is not at all an easy language to work with. You might want to look into TypeScript as a way to make quicker progress in that same domain, with Rust as more of a side-project to help you grok lower-level programming in general. > I might take some time to make a game in Rust one day... Game development in Rust tends to be especially challenging, since the main competition is C++ - another low-level language. Take a look at this example of a very simple Breakout game in Bevy, one of the most well-known game engines (though still very much at a highly experimental stage!) https://github.com/bevyengine/bevy/blob/latest/examples/games/breakout.rs https://github.com/bevyengine/bevy/blob/latest/examples/game... - this might help you realize the level of effort that's typically involved.
- apitman 2y agoLearning Rust is easy. I've done it 3-4 times now.