Code contracts allow developers to specify expected behavior and guarantees for code through preconditions, postconditions, and invariants. Microsoft Code Contracts provides attributes and a rewriter to automatically inject runtime checks for contracts in .NET code. However, the syntax can be ugly when specifying contracts inline. Spec# is an alternative that uses a cleaner syntax, separating contracts from method bodies to make them clearer. While the concept of design by contract is good, the implementation in Code Contracts is lacking - Spec# provides a better approach.