I'm trying to learn Rust and I have big difficulties with it. Just as with C++ at some point in time I understood that I can not learn everything and that there are some aspects of that language I've never heard of and I do not need them and I'd like to do the same thing with Rust.
Do you know any good books or youtube tutorials which focus on core features leaving all the other things aside so I could learn them at later time or never if I do not need them?
btw I know that Rust isn't that big programming language but its syntax sometimes makes my head hurts.
As always sorry for my bad english.
Do you know about the Rust book?
Yeah I've tried to read it but somewhere in the middle I stopped and I do not know excactly why but as I've already mentioned this kind of books/tutorials where person tries to teach you everything does not work for me very well. Anyway I'll try some other sources but maybe Rust is not for me and that's all there is to it.
Hey, I don't know what kind of programming you do, or want to do, but don't give up so easily.
Rust has some valuable new concepts to wrap ones head around and like you I sometimes find the syntax infuriating.
The hardest of all the new concepts is all the stuff about variable lifetimes and the borrow checker. But as it happens you need to understand those concepts get programs working reliably in most other languages.
As for the syntax, well, I could say the same about any other language that is not the one I know well and have become comfortable with over years. One gets used to it.
As a noob, I have probably ignored large chunks of the Rust book. Macros for example, anything to do with async. At some point I picked up enough to get programs running and found myself getting on with that rather than learning more about Rust. I really should get back to my Rust study.
Stick with it, I have a feeling you will find the effort very rewarding.
Try Rust By Example.
I thought it was good years ago. At a glance now, looks a bit heavier than I remember.
Unfortunately there is quite a bit of must know concepts that can't be avoided, or you end up with unpleasant code.
Tech is an industry where imposter syndrome is all too common. Don't put yourself down so easily. I'm confident that if Rust fits your use case, it is the language for you! With an open mind, Rust does not fit every use case. In your shoes, I would try to answer the question from that perspective.
I guess I should add that the underlying subtext is the same as described by others. Learning Rust is like learning everything, really. There's a certain amount of effort that must go into it. And that can be translated into time. You didn't wake up one day with a complete vocabulary, for example. You also didn't absorb mathematics through osmosis. You spent a great number of years learning both, just as we all have.
As someone already mentioned Rust by Example is a good place to pick up the basics (even if you skip some sections). Being in the same boat as you, I found the combination of Rustlings, Exercism's Rust track, and official books works well.
IMO this was good a introduction: Intro to the Rust programming language - YouTube
I was thinking...
That is thesis I reject despite all the weirdness of JS' type coercions and such that people like to make jokes about. What the book actually did was make a good job of making people aware that JS was a pretty sophisticated language with features that many other commonly used high level languages did not have and have been trying to acquire since. For example first class functions, lambdas, closures, prototypical inheritance, asynchronous (event driven) programming model (Looking at you C++)
"The Good Parts" pointed out JS's sophistication while skipping over the "boring parts" that are common to all other languages.
Similarly the question here presupposes that Rust has a lot of parts that are not good. Which I think we can all agree is not the case.
The book "Rust: The Good Parts" might then be a slender volume that concentrates on all the special and somewhat unique features of Rust, for example the whole variable ownership thing, life times, traits, macros and so on. Whilst skipping over the boring parts that are common to most other languages. Hopefully presenting these concepts/features in a way easily digestible by regular users of other languages. It might not be the book you are looking for.
I'm not sure what you mean there.
As far as I can tell JS was standardized very early on, before it had a lot of users. JS has remained compliant with the original standard whilst gaining some additional features with new revisions of the standard. That stability/dependability over time is a great asset to a programming language.
Do you have specific example of what you mean?
I like the title as well. It's catchy and to the point. I see the book as a reaction to the fashion for ridiculously gigantic 10Kg tomes that were a popular way to write books about programming languages. Possibly the first time a book concentrated on JS as a language in it's own right without dragging in all the crap that is the DOM API and the browser environment.
Well, the language was originally created in 10 days (1995), so what can you expect?
Off the top of my head:
I am familiar with all those resources. The "wat" talk is typical of hundreds of such criticisms of JS all over the web. Everyone loves to point and laugh at JS. I don't really buy it. It's not that they are wrong factually. It's just that in practice they don't matter much. Most of the "wat"s are down to not knowing the language and expecting it to be something else.
One could make the same kind of "wat" talk about C (and by extension C++). Given that C has so many undefined behaviors, platform/compiler defined behaviors and general sloppiness.
Wat, you can index off the end of an array?
Wat, you can call a null pointer?
Wat, you can use uninitialized variables?
Wat, adding int's of 32767 and 1 overflows sometimes?
Wat, C does not have a string type?
I could continue, I had so many "wat's" during my first week or two learning C. I could not believe a high level language would be allowed to do that, as my programs crashed into oblivion often bringing the whole machine down with it. Forty years later and nothing has changed in C in that respect, nor C++ by extension.
And yet, those same "real programmers" who pick on JS would not dream of pointing fingers at C and laughing.
A book called "C: The Good Parts" would be very thin
Some of these comments are getting close to language bashing, which isn't appropriate.
@twar, in addition to The Rust Programming Language book as already mentioned, you may be interested in a (paid) video series that @shepmaster and I authored called Rust in Motion, where we try to cover the concepts that are the most different in Rust compared to other programming languages. The hope is by learning these concepts, you'll have enough background to look up the syntax differences and APIs as you need them, but you won't get stuck on errors that talk about ownership, borrowing, and lifetimes.
No language bashing from me.
If you hear me speaking of Perl, Python, PHP or pretty much any other language that will probably be bashing
If you read some of the other threads in this forum, posted in the last few days, that ask questions about lifetimes, you'll get significant understanding of what they mean, why they are needed, and how the compiler uses them to ensure that safe Rust does not lead to use-after-free and other classical memory use errors. (Note that both Microsoft and Google have recently stated that 70% of their major security vulnerabilities arise from such errors.)
It's an odd thing. I know a good bit about C++, by no means all of it, I have used it on and off for decades.
C++ has me scratching my head more often than not.
Given the bugs that I have had to deal with when a team of contract C++ programmers is disbanded I gather that more serious C++ professionals than me don't understand it either
Now if only said contract C++ programmers had enforced all the memory safety rules that Rust enforces I would not have been left with crashing applications to fix and memory leaks to to track down after they were gone.
In short, one needs to understand ownership and borrowing in C++ as well. One needs to understand lifetimes in C++ even if the language does not enforce it. If you don't your code will crash, produce random results or leak memory.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.