Drawing on 35 years of coding experience, the author explores how to write defect-resistant code without relying on automated tests. Key techniques include: using non-nullable types and Result types instead of exceptions for business errors, embracing immutability to eliminate shared mutable state, leveraging strong type systems to prevent primitive obsession, applying 'parse don't validate' to make illegal states unrepresentable, and writing composable functions for clearer business intent. F# is used throughout as an example of a language whose syntax (pipe operator, computation expressions, deep equality by default) naturally reduces clutter and makes code obviously correct. The post argues that language features and design choices can reduce the number of tests needed by making mistakes harder to make in the first place.
Sort: