rust_brain_teasers_by_herbert_wolverson

Rust Brain Teasers by Herbert Wolverson

Book Summary

The Rust programming language is consistent and does its best to avoid surprising the programmer. Like all languages, though, Rust still has its quirks. But these quirks present a teaching opportunity. In this book, you'll work through a series of brain teasers that will challenge your understanding of Rust. By understanding the gaps in your knowledge, you can become better at what you do and avoid mistakes. Many of the teasers in this book come from the author's own experience creating software. Others derive from commonly asked questions in the Rust community. Regardless of their origin, these brain teasers are fun, and let's face it: who doesn't love a good puzzle, right?

What better way to exercise your brain and increase your Rust programming knowledge than with a collection of dynamic brain teasers? As you read through each of these puzzles and try to work out the answers, you'll not only learn about Rust's unique quirks and peculiarities, you'll also have loads of fun along the way.

Dive right in and get started with example code and sample problems that cover numbers and text, shadowing and memory, and everything in between. Try to figure out why a particular program won't compile, why it produces unexpected output, or why it panics and terminates with an error message. Once you've run the code and read the answer, it's time to get to the heart of the matter with a detailed explanation. Learn why a program produced the result it did, and discover how similar issues might affect the code you write in your own programs, even in Rust production. Sourced from engaging discussions within the Rust community, real-world problems, and even reader feedback, these challenges will certainly surprise, enlighten, and entertain you.

Are you ready to experience Rust like never before? Then sharpen your brain and get ready for a challenge!

As my first book, Hands-on Rust was approaching completion I was approached by PragProg to write a book for their new “brain teasers” line. The concept was intriguing: short code snippets, asking the reader to guess the result—followed by a discussion as to why the result might not be what the reader would expect. I was attracted to this as a learning technique: apparent “gotchas” are often implemented in a certain way for a good reason. Understanding the underlying reason would really help the reader broaden their language knowledge.

So I sat down, and started writing out unexpected results I'd run into when using Rust. This was actually pretty tough—Rust is a very consistent language, and Clippy does a great job of warning you when you aren't doing something as intended. I came up with a pretty big list in the end, and whittled it down to 23 that were worth writing about—and one just for fun. I focused on issues that beginner-to-intermediate readers are likely to encounter; if you're on the Rust Core Team, you probably know more about these topics than I do! I also tried to cover things that people have asked me about.

At 138 pages, it's a relatively short book—and consequently pretty inexpensive.

Topics covered:

Fair Use Source: https://users.rust-lang.org/t/rust-brain-teasers-now-in-print/74771

What You Need

This book assumes you have some knowledge of the Rust programming language. To work through the brain teasers in this book, you'll need a working Rust environment on any platform. You can install Rust by visiting https://rustup.rs/. You'll also need a text editor or Rust-friendly IDE.

About the Author

Herbert Wolverson has worked as a programmer and indie game developer since the late 1990s. He's taught programming and IT skills at a variety of levels, contributes to multiple Open Source projects, and is active in the game development scene.

Product Details

Research More

Fair Use Sources

Rust: Rust Fundamentals, Rust Inventor: Rust Language Designer: Graydon Hoare on July 7, 2010; Rust RFCs, Rust Scripting, Rust Keywords, Rust Built-In Data Types, Rust Data Structures - Rust Algorithms, Rust Syntax, Rust OOP - Rust Design Patterns, Rust Package Manager (cargo-crates.io - Rust Crates - Rust Cargo), Rust Virtualization, Rust Interpreter, Rust REPL, Rust IDEs (JetBrains RustRover, IntelliJ - CLion with JetBrains Rust Plugins, Visual Studio Code), Rust Development Tools, Rust Linter, Rustaceans-Rust User, Rust Uses, List of Rust Software, Rust Popularity, Rust Compiler (rustc), Rust Transpiler, Rust DevOps - Rust SRE, Rust Data Science - Rust DataOps, Rust Machine Learning, Rust Deep Learning, Functional Rust, Rust Concurrency - Rust Parallel Programming - Async Rust, Rust Standard Library, Rust Testing, Rust Libraries, Rust Frameworks, Rust History, Rust Bibliography, Manning Rust Series, Rust Glossary - Rust Official Glossary, Rust Topics, Rust Courses, Rust Research, Rust GitHub, Written in Rust, Rust Awesome List. (navbar_rust)


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


rust_brain_teasers_by_herbert_wolverson.txt · Last modified: 2024/04/28 03:44 (external edit)