Topic
Method Design
Visibility, return contracts, abstraction levels, and the difference between a method that acts and one that answers.
8 pages
Writing25 May 2020
Design Nugget: Evolution To Strategy
Build a working baseline, then change the design for a concrete benefit; a log parser evolves through a switch, delegates, and Strategy to test that judgment.
Writing20 September 2019
Extension Methods? No Thank You!
Keep project-specific helpers as static methods: extension methods hide behavior behind namespaces and can change meaning with imports. Use them when they serve the wider C# community.
Chapter20 September 2017
LINQ and Query Semantics in C#
A query does not run when you write it, and calling it twice may not give the same answer. Deferred execution, materialization, terminal operators, and untranslatable queries.
Chapter20 September 2017
Method Design in C#
Explicit visibility, why public members are never virtual, orchestration over implementation, and return contracts that state their cardinality.
Chapter20 September 2017
Method Design in Python
Pure and autonomous methods, why public methods orchestrate rather than implement, consistent abstraction levels, and the split between actions and queries.
Chapter20 September 2017
Naming Conventions in C#
Deriving names rather than inventing them, domain suffixes over indices, the Async exception, and why Retrieve and Search choose different failure contracts.
Chapter20 September 2017
Naming Conventions in Python
Naming a thing for what it is: variables named after their type, methods that state the domain outcome, and why inventing a fresh name at each site is where wrong names come from.
Chapter20 September 2017
Type Annotations in Python
Annotations as intent rather than decoration: None used deliberately, dictionaries kept out of method boundaries, and capability types that tell the truth.