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.
What awaiting actually does
card 6 of 6
Await is what makes it happen, in order
`await` runs the work to completion at that point and brings its result and its error back to your line. With no `await`, Python and Rust never run the work at all. JS/TS runs it, but you lose the ordering and the failure. Every call to an async function in a diff should be awaited, or be run in the background on purpose with its errors handled.
Terms on this card
- await
- Keyword that pauses the current async function until the given work finishes, then returns its value or throws its error at that line.
- diff
- The set of line changes between two versions of the code: removed lines start with '-', added lines with '+'.
- TS
- Short for TypeScript, JavaScript with static types checked by the TypeScript compiler.
- JS
- Short for JavaScript. Plain JS has no compiler check of names or arguments.
Lesson goal: Explain promises, futures and coroutines and what happens when one is never awaited. In Python the coroutine never runs. In Rust the future is lazy and does nothing. In JS/TS the work runs but its failure goes unobserved and ordering is lost. ·
the whole lesson