Use println! for output, vec! for lists, and todo! for placeholders to write concise Rust code.
Use println! to print text, vec! to create vectors, and todo! to mark incomplete code that panics at runtime. These macros expand into code during compilation, allowing for concise syntax and runtime checks.
fn main() {
println!("Hello, world!");
let numbers = vec![1, 2, 3];
let incomplete = todo!("Implement this later");
}
Macros are like reusable code templates that the compiler expands before your program runs. They let you write shorter code for common tasks like printing text or creating lists. Think of them as shortcuts that automatically generate the detailed code you would otherwise have to write out manually.