Why Learn Rust?

You might be wondering, why shall I learn Rust? In the About chapter you'll find plenty of reason to.

However, if you are a programmer coming from another language you might want to read the "Can Rust prevent logic errors?" article available at https://itsallaboutthebit.com/logic-errors-in-rust/# instead.

In the article "Can Rust prevent logic errors?" Piotr Sarnacki explores the potential of Rust, a programming language, to reduce software bugs, specifically logic errors. He highlights Rust's features such as the absence of nulls, the necessity to handle function errors, prevention of data races, and explicit marking of mutable variables.

Sarnacki contrasts Rust with Ruby, where runtime exceptions are common, suggesting that Rust allows for more stable applications. He discusses how Rust's expressiveness can help prevent some logic errors that might occur at runtime.

He also discusses how Rust's tools for managing data ownership and access control can prevent logic errors caused by unwanted mutations. Additionally, he emphasizes the use of enums in Rust to handle multiple options, which can prevent errors when dealing with multiple possible states.

In conclusion, Sarnacki believes that Rust offers many tools for writing correct software and its community's focus on correctness further enhances its value. Despite the potential for errors, he suggests that Rust has a relatively small amount of problematic features if misused.

Learning Rust

Becoming proficient in Rust requires the fulfillment of three pillars:

The sequence in which you approach each pillar is flexible—tailor it to your preference. While you may follow the steps as presented, this guide is best used as a reference and source of inspiration rather than a prescriptive manual.

These suggested paths highlight the versatility of this guide. The key is to enjoy the process and maintain consistent learning (e.g., approximately X hours per week). Your learning style and capabilities will dictate your journey and frequency of revisits. For instance, you might prefer to experiment with code before delving into the foundations, or you may want to fully grasp the basics before embarking on coding. The choice is yours.

However, one essential element is hands-on coding. Learning by doing is the most effective method. Don't shy away from making mistakes or trying new things—it will be a challenging but rewarding journey. Merely reading won't give you a true understanding of the language or its potential. So, engage in plenty of coding.

Even as you progress to advanced topics (e.g., Rust for Rustaceans), don't neglect the fundamentals. It's easy to forget what you've learned without regular practice. Thus, continue to balance basic and advanced studies—it's a continuous journey.

As you navigate this guide, you'll find alternative suggestions and varying levels of complexity. You might initially skim through a section, focusing on the foundational material, then revisit it later with more experience. This approach allows for spatial repetition, gradually shaping your understanding.

If you don't anticipate working on a project requiring Async programming soon, feel free to bypass that section for now. Just remember that Rust supports Async and it plays a significant role in the Rust ecosystem. You can always return to it when you're ready to strengthen your knowledge in this area.

Should you ever feel stuck or in need of a mentor, don't hesitate to contact Glen at glen@plabayo.tech to arrange a one-on-one session or a workshop for your organization. Whether it's a one-off or regular meetings, assistance is readily available.

Rust 101 Course

The origins of this guide can be found in the preparation of a semester long course I gave to a group of employees at OTA Insight Ltd.. The recordings of this course are available on YouTube at: https://www.youtube.com/playlist?list=PLQgXEsLXFxpVyLddG8FFXfNQEiodTzAjj. The videos are however not of the highest quality, especially given the many better resources out there.