Many students are curious and ask me how to learn technology in private messages. I happened to be learning Rust recently. As it is still fresh in my mind, I would like to take Rust as an example and talk about my learning style.

It doesn’t matter if you’re not interested in Rust. The ideas it contains about motivation, materials, time planning, training programs, and mind-building can also be applied to learning other technologies.

Note in advance: This article is only my personal learning strategies, for reference only.

First, sufficient learning motivation is the source power of continuous learning

Learning technology, especially new technology, is an activity with a high failure rate.

I don’t know how many times we’ve stopped at installing project dependencies, at the Hello World level.

Many students attribute these failures to not being smart enough, or not being persistent enough, or not having a partner to study with. However, there is a very important core factor that is neglected — motivation for learning.

Learning motivation is not an ethereal concept, the most common and obvious one of learning motivation is – work demand.

Job demand is a strong, continuous and externally driven motivation for learning. The technologies that are relevant to the job are often the ones that we have the most solid grasp of and that make up our core technical capabilities. And the ones that are less relevant to the job are the ones that are easiest to drop.

Insufficient learning motivation and early giving up is an important inducement leading to learning failure.

In addition to the demands of work, personal interest is another great source of motivation for learning. Most technical jobs may not require that much work, even if you can master the old technology stack for many years. When suddenly transported to the society, only to find their own technical competitiveness is insufficient. We need to find new motivation to continue to expand the breadth and depth of our technology.

Motivation, like emotion, needs to be cultivated. By mixing with various technology communities and listening to others promote different technologies, we can see the promises of those technologies, such as memory safety, type safety, cross-platform, high performance, ease of use, maintainability, and so on. Gradually, certain technologies plant the seed of interest in our hearts.

Once we have the seeds, we need to personally water and nurture these interests to make them more abundant. In all the technologies of interest, explore their potential value to our existing work. Even if it’s just inspirational value, we need to link our personal interests to the needs of the job so that we get a more lasting motivation to learn.

Take my motivational watering of Rust as an example:

My job is front-end development, which involves a lot of front-end framework design and front-end infrastructure construction.

The current front-end architecture, using only technology stacks such as JavaScript/TypeScript and Node.js, is a bit stretched. For example, Webpack implemented in JavaScript does not perform as well as it should when compiling and building large front-end projects. Vue author Xiaoyou Yu tries to optimize this problem by using the browser’s native module load management, namely the recently popular Vite. For Vite, it chose a high-performance JavaScript Bundler and minifier — EsBuild — that Figma CTO implemented with Go. Future front-end development infrastructures will include more and more tools supported by system-level programming languages. After all, V8, Node.js, and Deno contain a lot of C/C++ and Rust implementations. Everything that can be implemented in JS, even if it is eventually implemented in JS, the performance sensitive parts will be implemented in JS later.

That is to say, the pure JavaScript/TypeScript/Node. Js/Deno front-end architect, post competence and technical competence in the future, is likely to be weak in mastering a door or many system level programming language and its ecological counterparts. Therefore, students who are interested in front-end architecture should choose one or more of C/C++, Go, Rust and other languages for continuous learning, which may be helpful in the future. (Have you planted any seeds of interest here?)

Front-end infrastructure can be optimized with system-level programming languages, but there are other things you need to learn to design a usable front-end framework. Especially functional programming (FP), Programming language Theory (PLT) and Type Theory. For example, learn Haskell, understand Monad, master Algebraic-Effects, familiar with Codata and other concepts.

Based on the above work background, Rust has a prominent learning priority compared with Go and other languages.

1. Rust is a more modern language designed to incorporate functional programming features such as pattern matching, algebraic data types, traits, and Immutable by default

2. Rust comes from Mozilla and is a relatively friendlier support and investment for WebAssembly. Running Rust code via Wasm on modern browsers improves performance and is useful for specific, complex Web apps. Read more about this in Rust and WebAssembly.

3. Rust has achieved a better balance between Safe and Useful.

In a 2017 share of Escape from the Ivory Tower: The Haskell Journey, Simon Peyton-Jones, one of Haskell’s core developers, outlined an interesting chart:

Security and utility coordinates. Some languages, such as Haskell, start from security, and increase IO capabilities while ensuring security. However, most of the mainstream languages we use are based on practicability. In the case of ensuring sufficient practicability, we increase security by means of constraints such as Type System.

Safe but impractical vs practical but dangerous. Ultimately, everyone’s goal is to be both safe and practical.

And Rust is in a very good position to be both safer than most mainstream languages and more practical than more academic languages like Haskell.

Also, it’s worth noting that safety and utility are not diameterically opposed. The average developer may only be able to use the 60 useful parts of a 100 useful but insecure language, and only a few experts know how to use it at 100%. As security increases, so does the percentage of utility power that the average developer can land.

Simply put, Rust compilers allow us to be more confident that our code is memory-safe and type-safe, so we can dare and write more complex code without having to struggle with memory issues or waste a lot of time debugging. Through the above analysis, I have fed myself a strong motivation to learn Rust. Through Rust, I am expected to gain more abundant practical experience in functional features than in JavaScript/TypeScript, have the opportunity to write high-performance front-end infrastructure to optimize development efficiency, and have the opportunity to write high-performance WASM modules to optimize Web App performance. There are opportunities to borrow Rust language design ideas to implement a variety of possibilities such as a small Runtime, gC-free front-end DSL.

In this way, learning Rust is subtly related to the content of my work, creating a continuous source of learning motivation. In a similar way, you can tap into a strong motivation to learn a new skill if you want to.

Serious learning is a core part of effective learning

The fundamental purpose of learning motivation is to get us into serious learning.

There is a major problem with many students’ learning style, which is that they always stay at the stage of cultivating learning motivation. What do you mean?

I have been reading technical questions and answers, articles, technical videos and participating in some offline parties, but I have not considered the official website to install tools, download dependencies, read documents, write code, debug problems, search for answers and so on.

The technology community is for us to get interested in learning from other people’s technology publicity, to get the material for learning, but they do not equal serious learning by themselves.

So what is serious learning?

Serious learning is the process of learning through authoritative, first-hand, classical, and systematic learning materials.

Take Rust as an example. The serious process of learning Rust is to go to the website rust-lang.org, read the basic information on the front page, learn about the introduction and promises of Rust, install Rust and create a Hello World project by getting STARTED. Up and running.

Then we went to LEARN MORE. The official document directed us to read The Rust Programming Language, so we read and did The exercises in The book. Before we finish this book, we found another book, Rust By Example, to add to our reading list. Read the first book, read the second, and so on.

This is a process of serious learning, and the materials we use, published by official authorities, are first-hand, are systematic, and are Rust’s current primer. A lot of what we see in the tech community is other developers producing technical articles based on these serious materials, which are in nature afterthoughts. Reading is not first-hand, not authoritative, not systematic, not classical, not belong to serious study of the material.

Reading/learning experience compared with serious materials, more simple and relaxed, can help us to establish the initial impression and learning confidence of Rust and other technologies, but it is difficult to be used as a sufficient material to start Rust. This article itself is not a serious study, but rather a motivational material.

The human brain is a fastidiously sourced organ, and it disdains the small amount of gossip that is mixed up in the technical community. When you read something serious, such as textbooks, classics and papers, your brain switches to a more serious learning mode, remembering the information more easily and trying to relate it.

The links to serious material that stay in bookmarks are the key to effective learning, and the process of collecting and collecting them in the technical community is a stage of motivation.

After reading 100 articles, at least one relevant serious material should be read to sublimate and precipitate, to gather discrete knowledge points.

Three, high intensity intermittent is the secret of efficient learning

Once you have the motivation and the serious material, the next step is to plan your study time.

I have personally summarized a study tip, and I would like to share it with you.

High-intensity interval training, originally used for fitness, is now used to describe a time planning strategy for learning.

Making learning more efficient is essentially making the irrational part of the brain value the results of rational cognition. Rational cognition is a part of the human brain that evolved later than other functions such as visual processing, memory and language. As a result, human memory works largely independently of what we want to remember and forget. Before we had the ability to think rationally, we had the ability to remember information.

Therefore, we need to use a variety of established human characteristics, such as memory preferences and information processing preferences, to get the brain to remember what we rationally think is important. Learning serious materials, on the one hand, is to ensure that the content is correct and systematic, on the other hand, it is also to induce the brain to do profound processing.

Serious material has two meanings for our brains. One is the objective level, where learning materials are written by people in authority and have been tested and tested over time. One is on the subjective level, where the material is very important to me, very meaningful, very relevant.

After finding serious material, only the first level of seriousness is achieved. The second level of seriousness requires us to build ourselves. With so much serious material in the world, how do we prove to our brains that this is serious and important material?

One way to do this is to make these materials appear repeatedly, at high frequency, with high density and strength.

Plan out a period of time each day, half an hour to two hours, for example, I plan to study Rust serious materials between 10 p.m. and 12 p.m. Let Rust appear in front of me every day and be exposed to my mind every day, and as the time and frequency of its appearance increase, the brain automatically gradually recognizes the importance of Rust in my life. In particular, many problems and solutions will be encountered in the process of learning Rust. They trigger another cognitive preference in the brain — to be more sensitive to negative content. That is to say, for my brain, rust-related problems are constantly being created and solved every day, it will allocate more cognitive resources to process and digest Rust knowledge, and it will motivate us to be more interested in Rust because it will want to get more Rust information to process. The subjective experience is that we find Rust more and more fun.

High levels of continuous information exposure are necessaryThe learning method of “fishing for three days and drying nets for two days” is difficult to effectively activate the brain’s serious positioning of Rust or other technologies.

In addition to the high intensity part, the intermittent part is also important. It means that we must stop at proper times to have fun, rest and sleep. Do not forget to eat and sleep as far as possible to gnawing learning materials, as if a day to learn a complete book. This is not realistic, a day forced to read the whole book, does not represent the study of the whole book. The brain needs to process and integrate what it has learned during the day during sleep. Not stopping to provide opportunities to digest knowledge does not help physical health or quality of learning.

Combining the objective seriousness achieved with authoritative learning materials and the subjective seriousness achieved with high-intensity interval training ideas, we have serious knowledge that can be relied on both on the subjective and objective levels.

Even without understanding the serious learning strategies mentioned above, many students have intentionally or unintentionally optimized their learning process by increasing seriousness. It’s just that many of these strategies may not stand up to scrutiny. For example, enroll in a training class, increase the supervision role of teachers and students, to improve the seriousness of learning; For example, go to the study room, Starbucks and other places to increase the seriousness of the learning atmosphere; Such as buying physical books, setting up a rich sense of ritual environment to study and so on.

In a short time, these practices certainly improve the seriousness and quality of learning; But it’s not free. All this formal, atmospheric seriousness can be costly. For example, when we bought the Rust physical book and came back, it was obvious that it was as thick as a brick.

Maybe every time I study, I have to summon up great courage to turn over the thick books. Wash and dress up, go out and save a seat in the study room or at Starbucks, and then start your study journey. The cost of starting learning is so high that we may not be able to learn, and the big brick books end up on the monitor.

My personal choice is to study online. My Chrome is set to restore the links that were open the last time I closed them each time I opened them. The Tab page of Rust materials will always appear in my browser before I finish my study. As long as I have the mind, I can quickly switch the Tab to study, and quickly start VSCode to write and run the code.

The seriousness of the material, which contains real knowledge. The seriousness of learning environment and learning atmosphere does not contain knowledge. Assuming that the training class teacher’s own level is not excellent, the selected textbooks are neither systematic nor authoritative, then serious learning atmosphere we may not absorb reliable knowledge. Effective learning happens when we immerse ourselves in serious material, no matter what the environment or the atmosphere. When making a study plan, we need to make clear whether the dry parts of effective learning are optimized: 1) we are looking for material that contains serious knowledge; 2) We’ve managed to convince our brains that the knowledge is serious and that we can remember it for a long time. That is, serious knowledge is unified by subjective and objective.

Start serious learning as cheaply as possibleMay be a better approach.

Fourth, super – key training is a reliable way to consolidate knowledge

After you’ve found serious learning materials and studied them solidly and carefully, the next stage is superdiscipline.

Reading the book once does not mean that you fully understand the knowledge in the book. We have to prove to ourselves that we actually have some degree of understanding.

How to prove it?

Do exercises that have no reference answers, known as superdiscipline exercises.

In my study of Rust, for example, The Rust Programming Language led us to implement a simple grep CLI program, a simple multithreaded Web server. However, our code implementation is too similar to the answer in the book. Even if we could memorize the answer, it wouldn’t convince our brain that the code is our own production.

So, after reading The Rust Programming Language and Rust By Example, I assigned myself a new training program — raytracing.

Ray Tracing in One Weekend is a small step-by-step book with code implemented in C++, and we can do a re-implementation with Rust. So to form a superclass training, our code has reference, but not Rust code, but C++ code. We need to complete three levels of understanding: 1) understanding raytracing algorithms; 2) understand C++ implementation; 3) Use the Rust implementation.

Raytracing is a particularly good training program for learning a new language. It includes a variety of language features, has performance requirements, and is mostly mathematical. The output is a list/array of numbers, which requires almost no other API and can be used in a variety of environments.

The functions of Rust for raytracing are as follows:

0) Basic features: variables, loops, basic control flows, pattern matching, data structures, numerical calculations, modules, file system interfaces, etc

1) Operator overloading: Operators such as +-*/ on Vec3 data structures need to be overloaded.

2) Trait Objects: Multiple types of geometry, multiple types of materials, need to be able to be placed in a list or field for unified processing.

3) Recursive function: Raytracing algorithm is a recursive function in the continuous generation of new ray path algorithm

4) Use of packages/Crate: RAND and Threadpool

5) Performance optimization: Use multithreading to optimize raytrace algorithm performance

6) Unit testing

7) Read cli parameters

8) Code organization structure design

9)…

Basically covers a large part of Rust’s core language features.

As shown above, following Ray Tracing in One Weekend, we implemented a dozen graphics renderings with Rust, ranging from simple to relatively complex, with over 1000 lines of valid code (with the duplication between demos removed).

In this way, we completed a superclass training, which was bound to be a lot of confusion and problems. We went back and forth through The Rust Programming Language and Rust By Example, and looked at The documentation of The Rust library. Check out Crate documents, Google other queries, and more. It is these questions, and the process by which we search for answers, that reinforce what we miss, consciously or unconsciously, when we read.

Superclass training can be continuously upgraded. The more levels of upgrade, the higher the degree of completion and quality, the better the training effect. Of course, the training will become more difficult, and at some point, we will stop. For example, the previous part of the raytracing optimization with multithreading, even an upgrade, was not included in Ray Tracing in One Weekend.

Another upgrade is that we can run Rust on a browser via Wasm and then compare the raytrace algorithm implemented in JavaScript to see the performance difference. This fits into one of my motivations for learning Rust: to use Rust + Wasm to optimize performance for specific tasks in the browser.

So I started reading Rust and WebAssembly, another guide on Rust’s website, to learn how to run Rust code in a browser, and then to adjust our Rust raytrace to Library Crate.

As shown above, Rust + Wasm implements Ray Tracing rendered to the browser’s Canvas. The first image is the render result, and the second image is the rendering times of each pixel (the more times, the whiter).

It is worth mentioning that the top navigation bar also has JavaScript and Rust: Small Image modules. The JavaScript version is a superoutline training project that I did more than a year ago when I learned ray tracing algorithm. I’ve also written three articles on how to optimize raytrace rendering performance: React Optimization Techniques for Web Raytrace applications: Top, Middle and Bottom, which can be used to compare performance with Rust.

The Rust: Small Image module is another superclass upgrade. Previous renderings have been static with a single image because the current implementation does not support the performance requirements of real-time raytracing. But, now that we’re all in the browser, isn’t it always more interesting to tie in some user interaction, switching viewpoints and things like that? Moreover, Rust + Wasm does perform much better than a pure JavaScript implementation. We lowered the resolution of the image, reduced the number of objects, and achieved a simple, interactive implementation of raytracing.

As you can see above, although the experience is not particularly good, it’s nice to be able to adjust the perspective. If you are interested, you can visit the Demo address and try it on your PC.

So far, that’s all I’ve been doing. There’s more to be done. There are three books in the series written by the author of Ray Tracing in One Weekend, and there are two more that I haven’t done yet. Even when you’re done, you can upgrade to a more serious open source project by becoming a Raytrace crate in Rust Ecology. It’s all possible, but it’s not my current goal, so I have no plans to work in that direction. All in all, raytrace has served its purpose as my superdimensional training for learning Rust.

Superclass training is important because once we take the technology we’ve learned and put it into production. We face all kinds of problems, almost are superclass, there is no book reference answers for us to copy. Therefore, after learning the official books and tutorials, immediately start a superprogram to consolidate, can effectively improve the quality of learning.

5. Accumulation of achievements is a necessary condition for acquiring technological confidence

The final step in a learning journey, and one that is most often overlooked, is to bring the journey together into a signature outcome.

The results can be big or small. Small to practice achievement, big to scientific research achievement. It is a milestone that signifies the value of effort at a given time.

It can be a specific product or a summary article. When we finish the superoutline training, we actually have one natural learning outcome, and when we write an article, we have another learning outcome. Although these results may seem insignificant to us in the future, we still need a result now.

Our brains need a productive stimulus.

What separates a successful learning experience from a failed learning experience when you give up? Is the results.

As mentioned earlier, Rust Raytrace is also infinitely upgradable, with no end to learning. No matter what I do, I’m essentially giving up halfway to unlimited difficulty. Therefore, we need to create a phase outcome that clearly defines the learning journey as successful and fulfilling expectations. The Demo project hosted on Github, along with this article, are part of my progress in learning Rust.

As we learn more and more techniques, we accumulate more and more stage achievements and articles. I can invoke the JavaScript version of raytracing I learned last time in Rust Learning Outcomes; In this article, I can quote three articles I wrote last time. These phases, layered and interwoven over time, can tell our brains that they’re really useful, they’re valuable, and they’re worth remembering.

Accumulated achievements, some large and some small, some that have been promoted and even widely recognized by others, make up your achievements. As we have more achievements and achievements, our technical confidence will also increase, and it will be easier to start to learn new techniques and create new stage results.

We need to preserve the results, to leave traces, to prove them. Once we know that there is no longer anything to prove that we have learned and achieved certain goals and outcomes, our brains may no longer see them as relevant to our lives. And if we always remember where we can pull something out as evidence of our efforts and their value, our brains will be more willing to retain that knowledge for a long time.

For technology learning, a Github repository is a great medium to store results.

Mentality building is the key to happy learning

Learning technology is a long-term, perhaps even lifelong learning activity. In this process, we will encounter many myths, which may reduce our enjoyment of learning, may hit our confidence in learning. How to resist these negative thoughts, the correct view of all kinds of confusion encountered in study, is the direction we need long-term efforts.

A few myths are discussed here, hoping to shed some light.

Failure is the normal of learning, success is rare

Set out on a learning journey, only to fail. This is a very normal phenomenon, all people often encounter.

Am I going to collect quantum mechanics textbooks for serious study and I’m going to be able to do it? The probability is too low.

A lot of learning is a pre-knowledge requirements, before meeting these requirements, leap-over to conquer some knowledge, double the effort, failure is very obvious. However, most of the time, we really do not know what we want to learn, what is the pre-requirements, whether I have these conditions. We can only learn to learn by ourselves, with actual action to test whether I now have to learn these technical qualifications.

That is to say, embarking on a journey of learning is itself an unknown adventure. Learning failure, instead of being an entirely negative sign that we’re totally screwed, provides a lot of positive clues: 1) the material isn’t suitable for my situation; 2) I need to find other materials; 3) I need to try again after a period of time with other accumulation.

To stop low quality, or even ineffective, learning is to stop your loss and to save energy for more rewarding learning. Don’t be discouraged, there is still time to come. Next time, when we come back, the odds are better.

We accumulate our successes, but we don’t have to count our failures to make us sad and demoralize.

6.2, do not have to blindly compare learning efficiency

In learning, we sometimes can not help but compare with others learning efficiency, want to set a day to learn XXX technology rhetoric. Once we get stuck in the learning process, especially when we get stuck on basic concepts, we feel anxious that we are not learning smoothly enough, slowing down our learning efficiency.

On second thought, however, we find that these little thoughts do not hold water. First of all, we are learning, that is, we are facing the unknown things, how do we know how many days it will take us to master? Even if we get it right, it’s an unwarranted guess, a coincidence. When there is no external time pressure, why would we want to limit one study time? If the goal is to learn the skill, then keep the pace of learning at your favorite pace and move on quietly until you’re done. The length of time, vary from person to person, do not compare.

Second, there’s nothing to worry about when you get stuck. By “smooth learning,” if you mean not getting stuck, it means you haven’t learned anything. It’s all about problems that are essentially known and solved. Stuck means we’ve hit a learning point, which is something to be happy about in some way.

If we get stuck and choose to skip the question and go straight ahead in pursuit of this percentage of reading progress, we may incur untold costs. After we finish the tome, we think we’ve mastered the basics, that we’ve passed the stage of learning the basics from scratch, and that it’s time for actual combat or more advanced learning.

However, in fact, our basic knowledge is not solid, we skip the basic concept that we do not understand at the time, it will haunt us repeatedly, become the bottleneck of our progress. We think that because we’re not smart enough, that’s why we haven’t been able to improve. We may never know, because we skipped the basics, we don’t know what we’re missing.

Therefore, in serious study, it is not easy to skip anything unless you have put in enough effort to prove that it is useless to continue to struggle.

Before learning Rust, I already had experience in learning and using JavaScript/TypeScript, Node.js/Npm/Webpack, Haskell and other languages, runtime and tools. Many of Rust’s syntax, features, and concepts are not new to me, and I seem to be able to skip a lot of them and write code as I look them up, using Examples and Cheat sheets.

But I didn’t.

I chose to resist the impulse and read silently a little bit, to cultivate my mental model of Thinking in Rust with solid reading. Once we choose to use Haskell’s concepts to understand the properties of Rust, then Rust is less likely to be considered first class by our brains. It may be considered derivative, secondary, and we just have to remember Haskell. Writing Rust code with a Haskell flavor makes it difficult for others to adapt and for yourself to adapt to the code conventions in Rust.

Serious learning requires less laziness and more solid, honest, humble reading of systematic material, which will give us inestimable value in the end.

Instead of thinking, am I learning efficiently enough, am I learning more efficiently than others, think, am I learning faithfully?

Learning efficiency is an objective statistics, is our solid learning after the end of the calculation, when we take a shortcut, quickly browse the content without understanding, speed up the progress, our learning efficiency has not improved, but it can not be correctly counted. Only when our study is sincere and solid can our reading speed reflect our learning efficiency. Otherwise, reading speed is just reading speed. It does not mean my learning speed. It does not mean that I fully understand the content.

We don’t know whether the acceleration at the beginning of learning leads to slower learning later. We can’t blindly speed up entry because it’s hard to assess the consequences of technologies we don’t yet understand. Sometimes it seems stupid to study silently, but may make our subsequent learning more smooth road.

Serious and sincere learning, if not the best learning strategy, is obviously not a bad choice.

6.3. Don’t be an anxious learning machine

Study can be a happy thing, we do not have to pursue every day to have progress in study, do not feel that a day without study, will fall behind others.

People’s growth curve, may be intermittent leaps and bounds, coupled with a long period of stagnation or even regressive, constitute the fluctuation. Once or twice a year of high quality serious study is impressive.

Enjoy the fun time that seems to be unsatisfying, and then take every opportunity for serious study seriously.

Vii. Summary and Review

Humans are story animals, and learning is the heroic adventure story we tell our brains. Searching for interesting content and learning motivation in the tech community is a treasure trove of clues for our brains.

Serious learning material mined in the tech community is a treasure map for our brains.

When we embark on a serious journey of learning, our brains are officially on a treasure hunt.

Sincere and faithful learning, is to let our brain not miss any knowledge treasure.

To establish learning outcomes is to convince our brains that we have finally acquired the treasure of knowledge that was the goal of the expedition.

That’s all for this article. I hope this article can inspire you to learn new technologies. Click rust-Ray-Tracing -Demo to jump to the Github repository, which contains my training code for learning Rust for reference.