The self-learning article series on Rust has now reached the Iterators article, almost covering the basic knowledge of Rust, after which comes advanced knowledge such as smart pointers, async/await, channels, and much more. But I must honestly say to the readers that in the end, the knowledge retained in my head is quite minimal.
If you have been following the article series about the self-learning process of Rust, most of what you see is theory recorded according to the original article at The Rust Programming Language. It simply filters out some concepts deemed important and worth remembering, rewrites them, and shares them. Still, I encourage readers to read the original article for the most detailed view. The articles here are just shortened versions summarizing the essential knowledge.
Ultimately, they are all theory, and theory can be forgotten and often not applicable in practice. Now, if asked to write a program in Rust, I would be cautious as I do not know where to start, and I am unsure if I still remember the syntax!
Recognizing that limitation, I have recently decided to change my learning approach. Alongside theory, I engage in more practice. Currently, I am struggling to solve Rust exercises from the repository mainmatter/100-exercises-to-learn-rust - a collection of 100 short exercises to help familiarize oneself with syntax and concepts. Additionally, I refer to other Rust learning materials from sources such as Google's lecture series: google/comprehensive-rust and rust by example - a collection of short examples on how to use Rust.
But why must I force myself to do these things?
Learning must go hand in hand with action - everyone knows this because practice helps turn knowledge into skills, verifies and consolidates what has been learned, and cultivates flexible thinking for real-world application. When learning without action, knowledge easily fades away, making it hard to use effectively.
My current way of learning Rust is merely reading the documentation and jotting down what I understand, explaining it through a short article. This helps summarize and systematize the knowledge I have learned, and writing it out also serves as a way to learn, helping me remember better and importantly, if there are mistakes, someone can point them out, which is another form of learning something new.
If asked to create a project starting with Rust, writing simple programs like summing numbers, calculating factorials, Fibonacci sequences... would not be an issue; I just need to review the basic syntax and apply it to write the program. However, for more complex logic, I fear I might struggle.
In reality, the knowledge learned compared to when applied is like night and day. It is not about a simple summation program but rather complex business logic required by a client. This is also the reason why people easily feel discouraged when learning a new language that cannot be applied in practice. It feels too difficult compared to the language they have already mastered. Humans tend to prefer simpler problems; the less thinking required, the more the brain favors that task.
Thus, practice is crucial if one wants to become proficient at something, even if it is initially challenging. Before wanting to finish, think about why you started in the first place.
Why learn a new programming language when my primary work involves another? Wouldn't it be better to focus on one and become proficient at it? I don't know what you think, but for me, learning a new language is very beneficial.
First, let’s find an answer to why there are so many programming languages created. Why doesn’t the whole world unify under one language? If you can answer this question, I believe you will recognize the true benefits of learning something new.
Programming languages exist to solve problems that other languages cannot, depending on the functions, positions, and problem-solving capabilities of the language, it unleashes its full power. For example, JavaScript is not used for programming microcontrollers because it is simply not designed for that. Conversely, how many people use C/C++ to create interfaces for a modern website?
Because a language can solve problems that another cannot, learning a new language helps us understand better why it can address issues that others cannot. We learn new rules, new patterns, and things that have never appeared in our own language, seeking answers to the deeper question: "Why does it have such a design philosophy?"
In short, learning a new language helps break free from the comfort zone. It broadens understanding and connects the disparate knowledge gathered over time.
What is important should be repeated three times. Recently, I have been practicing with Rust more. I have revisited old knowledge and solved Rust exercises to familiarize myself with the new syntax. I must admit to the readers that skimming through the material is always more pleasant than rolling up my sleeves and planting seeds.
That said, learning theory is not necessarily redundant. Theory helps visualize what is available. At least when looking at exercises, one can recognize keywords and their functions rather than being completely clueless as if encountering something for the first time. Solving exercises acts as practice, turning theory into solid knowledge, experience, experimentation, and gradually becoming one’s own experience.
From my perspective, the difficulty in learning a new language is mapping what you know onto what you don’t. It's like asking if JavaScript/Node.js has a similar feature in Rust. This can be both an advantage and a disadvantage. The advantage is that it helps experienced programmers approach the new material faster. The disadvantage is that when trying to forcibly transfer old knowledge onto new, sometimes the new language may not have it, or there may be a better way to do it, leading to confusion and panic. Moreover, each language has a different approach, so if viewed from the current angle, it is challenging to accept the new material.
I must confess that Rust is very complex; reading its documentation feels like confronting a massive amount of information, including syntax and design philosophy, which can easily discourage anyone. But do not let your mind deceive you, as it always prefers easier tasks that lure us to overlook the more challenging ones. Always remain aware that you are the master of your mind.
Another important note is that while learning Rust, turn off the code suggestion feature of the editor. Typing things out yourself will stimulate more brain activity and train your reflexes. If you merely tab, tab, and tab, you are simply wandering through a forest of flowers without knowing how to cultivate them.
Nowadays, self-learning is no longer too difficult, thanks to assistance from large language models. I remember back when I was self-learning Go, I struggled with dozens of questions without answers. Now, I just need to ask LLMs, and they will explain the issues in detail for you. However, LLMs only become genuinely useful if you know how to ask questions rather than rushing to get immediate answers. Since they know a lot, the answers often provide direction; if you are not careful, you can easily fall into a never-ending loop of irrelevant information.
Finally, this series of articles on a month of learning Rust will continue; I just don't know if I will have enough time to write more. Thank you all for your interest.
Looking back on a month learning Rust, I realize that focusing solely on theory is insufficient to turn knowledge into practical skills. Although summarizing and recording information from original materials helps systematize and reinforce knowledge to some extent, it cannot replace practice. For this reason, I decided to change my approach, combining theory with practice through solving exercises from various sources. This not only helps me become familiar with the syntax but also trains problem-solving thinking in real situations, even though initially this requires considerable effort and can be discouraging.
Learning a new programming language like Rust is not just about overcoming initial difficulties but also about expanding understanding, exploring new design philosophies, and stepping out of the comfort zone. Understanding that the learning process requires patience, overcoming personal laziness, and effectively utilizing resources and assistance from large language models makes learning much more manageable. How about you, dear readers? Do you have any tips for learning better? Please leave a comment below the article!