# Leslie Lamport: Thinking Above the Code

> For agents: start with the [agent guide](https://ratstack.sh/llms.txt). Every page is Markdown by default; add `Accept: text/html` for HTML.

[Microsoft Research](https://www.youtube.com/@MicrosoftResearch) · Published 2014-07-15 · 59:50 · A tier · Systems thinking

[Watch on YouTube](https://www.youtube.com/watch?v=-4Yp3j_jk8Q) · [All RatTube videos](/tube)

## Summary

Leslie Lamport argues for thinking and writing about a program before coding it. He models a behavior as a sequence of states and a program as the set of behaviors it permits.

Examples including Euclid's algorithm and quicksort show specifications above implementation details. Lamport discusses model checking and mechanically checked proofs, then recommends writing specifications for code that someone may need to use or change later.

## Section notes

- [11:28](https://www.youtube.com/watch?v=-4Yp3j_jk8Q\&t=688s): Programs are modeled as possible behaviors, each a sequence of states.
- [22:28](https://www.youtube.com/watch?v=-4Yp3j_jk8Q\&t=1348s): Model checking and mechanically checked proofs offer different ways to examine correctness.
- [32:47](https://www.youtube.com/watch?v=-4Yp3j_jk8Q\&t=1967s): Quicksort is specified without choosing its partition implementation.
- [43:38](https://www.youtube.com/watch?v=-4Yp3j_jk8Q\&t=2618s): Writing before coding makes the intended behavior explicit for future readers.

## Key concepts

No matching wiki page yet.

## Our take

Leslie Lamport argues that every program deserves a specification written before the code, the way a building gets a blueprint, and especially concurrent and distributed ones.

## Related videos

- ["Simple Made Easy" - Rich Hickey (2011)](/tube/simple-made-easy-rich-hickey-2011)
- [John Hughes - Testing the Hard Stuff and Staying Sane](/tube/testing-hard-stuff-john-hughes)
- [John Hughes - How to specify it! A guide to writing properties of pure functions | Code Mesh LDN 19](/tube/how-to-specify-pure-function-properties)
- ["Tackling Concurrency Bugs with TLA+" by Hillel Wayne](/tube/tackling-concurrency-bugs-with-tla)

Summary based on the transcript. Written 2026-11-15.
