How to approach learning a new language
Typically, the first steps in learning a programming language involve understanding its syntax, data structures and control flow expressions before tackling a specific problem. This is termed as bottom-up learning, and it's essential to understand the terminology of the language and its ecosystem.
Bottom-up learning resources typically include:
- Books
- Documentation
- Tutorials
- Interactive exercises
Although necessary to master a topic, bottom-up learning has the issue that learners often get stuck in tutorial hell, where they're constantly being exposed to new concepts without actually building anything end-to-end. In addition, bottom-up learning can leave learners frustrated because they're not able to see the bigger picture and how the different parts come together as a whole.
In contrast, top-down learning follows a more pragmatic approach that's grounded in the real-world. For this, a more abstract way of thinking is required. The learner identifies a problem statement in their domain and they learn just enough of the language to solve the problem at hand, going deeper only as needed.
Top-down learning resources typically include learning by example, using any of the following resources:
- Existing codebases
- Blogs
- Podcasts
- Videos
Top-down learning is not a replacement for bottom-up learning. The best way to become proficient and productive in a language is to combine both approaches and do them together.
Don't reinvent the wheel
When learning a new language, it's tempting to start from scratch and build everything that's required to solve a problem from the ground up. This is a slow, sometimes painful process if you're just starting off, and can result in inefficient, unidiomatic code.
Both Rust and Python have rich package ecosystems, and this book leverages them to the fullest extent possible. After all, most great software is built on the shoulders of giants. Reading through existing codebases for libraries, tools and frameworks is a great way to learn how to write idiomatic code in a language, and to understand the performance implications of your code.
Prior reading
It's recommended to have a basic understanding of Python and Rust before reading this book. If you're new to either language, consider reading the following resources. It's okay if you don't absorb everything in the first pass -- the goal is to get a high-level understanding of either language and their ecosystems.
- Python Crash Course for hands-on Python concepts
- The Rust Book and Rust by Example for an introduction to terminology and concepts in Rust
- Rustlings for a gentle introduction to compiling and running Rust code
Once you have a handle on the terminology, you can start by getting your hands dirty with the pieces provided in this book. Or better yet, use this framework to create your own pieces for your domain of interest and start writing some code!