Been learning Rust for a while now, building some wheels off and on in my spare time. Through this series of exercises and imitations, I have some new insights into how to learn a new programming language. This article is not about shortcuts or 7-day mastery, but about continuing to use the dumb way to learn.
From my point of view, the introduction of the former is too simplistic, just telling you what to do, but not how to do it. The latter is too difficult, and for most people, it is almost impossible to think about doing such a thing. As for the difficulty of this article, it is just in between the two. As for whether it is in the middle, it is hard to say. The level of difficulty varies from person to person and with time.
As the understanding of programming and computers is getting deeper and deeper, things that were moderately difficult will become easier because they have been done; and things that were previously complicated, if we haven't done it yet, we may still think it is still quite complicated.
Why learn a new programming language?
After working for many years, we still discuss with colleagues and friends: business is eternal and technology is always changing. Therefore, becoming a business expert is easier and more sustainable, and becoming a technical expert is more difficult and requires continuous improvement. It’s hard to choose because we’re not Martians and we don’t have a God perspective. Therefore, to become a technical experts, we need to constantly be in contact with new things and accept some new concepts. One of these patterns is, as people often say, learning a new language every year.
From a personal perspective, this is a very SMART (specific, measurable, attainable, relevant, time-bound) goal. Therefore, it will also have some advantages:
- Keep the habit of studying.
- Add sesame oil for technical passion.
- Learn different programming patterns.
- Expand career opportunities and prospects.
In addition, from the perspective of professional chicken soup, it is: opportunities are reserved for those who have opportunities. If you learn a new programming language, there are related opportunities in the future that you are more likely to touch.
If you regard learning a new programming language as very hot rhetoric of involution, struggle, etc., then I have nothing to say. Some people are really “struggling”, and some people want to know all kinds of interesting things. From my point of view, learning a new programming language has nothing to do with the above rhetoric – there is no competition, just add a track, lol.
Find an efficient path to learning a programming language
In the above, the first article I mentioned, ” The Art of Learning – How to Learn a Skill, a Language ” is already quite a waste of time for me today – repetitive work. The method mentioned in the article is nothing more than building repetitive wheels and rewriting old applications. This method and such as practicing different projects in 30 days are only practiced under specific scenarios and for specific goals. rubbish product. As we grow, things in life and work take up more of our time. Although I have not been troubled by these problems, I have one solution after another. However, I am sure you will all have these questions.
Simply put, we need to learn a programming language without duplicating labor. So, the way to go is to learn a new language and find new wheels in a new programming language. Such as ” How to learn two programming languages at the same time? ‘” is a good way, but for most people, it’s a bit difficult. However, from a personal point of view, if you choose to start with an XML parsing or JSON parsing, it may not be that difficult. However, it’s just repeating the wheel.
After such a circle of nonsense, in fact, our conclusion is: that in the suitable scene of the language, building suitable wheels – may mean a certain time cost. For example, use JavaScript to process non-relational data, use Go to develop cross-platform command-line tools, use Rust to develop WASM applications, and so on.
Efficient path
After a series of wheel-building attempts, I have an initial model (based on Rust). I have temporarily divided four paths:
- Project implementation. That is, what practices are required when developing an app when using the language.
- application development. Understand the body of knowledge required to develop a complete application.
- framework design. How to use the language for various abstract designs.
- language practice. Either use it to write parsing or parse the language.
- Domain-specific programming/scenario programming. That is to find the scene suitable for the language.
Like the first version, this path may not necessarily match your needs, but as we continue to improve, we will eventually be able to form a more complete path.
Engineering implementation in programming language
From the perspective of engineering implementation, what we need to master is some basic programming skills:
- automated test. Unit testing, integration testing, and other types of testing are examples. to help us develop high-quality applications and save debugging time.
* TDD (Test Driven Development). Ditto. From a personal point of view, mastering TDD as a skill enables you to write high-quality code.
* Test coverage.
Continuous integration. Real software development requires continuous integration, which is the engineering skill we need to master when learning programming languages.
Build management. Find a build system suitable for the language to help us build trusted software.
For example, when we use Rust to develop applications, we can use GitHub + Travis CI to complete the understanding of continuous integration; combined with Just file/Makefile, etc., to complete automated construction.
Application development
Application development is based on the perspective of real projects to complete the practice of the language. These include:
- Automated deployment. It is mainly used to learn how to submit efficiency under real projects.
✧ Containerized deployment.
- Layered Architecture. How reasonably divide the target structure of the project, there are two common ways:
✧ MVC stands for Model View Controller Architecture. Traditional three-tiered design
✧ Clean architecture. Architecture based on abstract formal design
DevOps system. Complete support from requirements to go live process as needed. like:
Application performance monitoring.
log.
There may be some differences between different languages, but in the end, they all need to provide a consistent interface or adopt a consistent interface. For example, for database access, the interface used is consistent; to provide a RESTful API, it is also necessary to provide a consistent API for consumers.
Framework design
The frame design is based on the path of the wheel-building requirement scenario. It contains:
- abstract. How language abstracts
- OO is supported.
- OO is not supported. How to do something like this with Rust Trait
- Language is irrelevant. How to do cross-language design support. like:
- Language-independent data format.
- Modular development. How to complete code and service sharing across teams and business modules.
✧ Package management/dependency management. Such as how to build and publish to the product warehouse to achieve reuse.
The frame design is theoretically a little more complicated. As for whether it is necessary or not, it depends on how much you want to learn.
Language practice
The language practice is How to learn two programming languages at the same time? “A path method under the mode, which will be relatively steep.
- Write parsers for other languages/DSLs.
- Write a parser for that language in another language.
- Use this language to parse the language.
Hmm, doesn’t that make sense? Scenario-wise, when we get the AST of a language, we can try to do some high-end things. Such as automated refactoring, architecture visualization, etc. I did in Coca.
Domain-specific programming
Domain-specific programming is doing what the language is good at, in the context that the language is good at. as in Rust
- Cross-platform
- WASM
✧ One application runs across terminals
system-level programming
✧ Combined with system interfaces, such as taking user input and modifying the output.
It depends on us recognizing the scene and knowing when is the right situation.
Other
There is no silver bullet, if there is, there would be no need for humans.