Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Rust tells: unwrap, clone and RefCell to appease the compiler card 5 of 6

The credit that lands on a copy

builds on: Silencing the checker: type escapes and suppressions, Error handling idioms across languages
The agent first wrote `self.accts.get(id)` and hit "cannot assign to `a.balance`, which is behind a `&` reference". Its fix is BAD, with two tells. `self.accts[id]` panics on an unknown id, just like `.unwrap()`. `.clone()` makes the credit land on a copy that is dropped at `}`. It compiles, and `self.accts` never changes. Later cost: credits silently lost. BETTER borrows mutably and returns an error for a missing account.
// Rust
// BAD
fn credit(&mut self, id: &str, amt: u64) {
    let mut a = self.accts[id].clone();
    a.balance += amt;
}
// BETTER
fn credit(&mut self, id: &str, amt: u64)
        -> Result<(), LedgerError> {
    let a = self.accts.get_mut(id)
        .ok_or(LedgerError::NoAccount)?;
    a.balance += amt;
    Ok(())
}
Terms on this card
.unwrap()
Rust method on Option/Result that returns the inner value, or panics if it is None or Err.
.clone()
Makes an independent copy of a value. Changes to the copy don't affect the original. For Rc/Arc it only copies the pointer.
later cost
The concrete damage a shortcut does after merge: hidden bug, data corruption, maintenance burden.
panics
In Rust, an unrecoverable runtime error that by default stops the current thread with a message.
Learn this step by step on Bytewise
Lesson goal: Recognise Rust-specific shortcuts: `.unwrap()`/`.expect()` on fallible paths, `.clone()` scattered to dodge borrow errors, and `Rc<RefCell<_>>` or `Arc<Mutex<_>>` used where ownership needed redesigning. Explain the panics and runtime borrow failures these trade for a clean compile. · the whole lesson