Logic for Programmers by Hillel Wayne
Summary
Hillel Wayne argues that formal logic enables programmers to determine if function updates break user workflows by using sets, predicates, quantifiers, and implications.
Logic aids practical programming.
Applying logic improves testing and helps developers understand complex operations such as left outer joins.
A small bit of logic helps us programmers in all sorts of ways
Specifications require implication.
A formal contract defines a function by stating that if a precondition is true, then the postcondition must be true.
the precondition is true, implies the post condition is true
Tightening postconditions preserves compatibility.
New versions can safely replace old ones if the new postcondition implies the old one, making the output more conservative.
new implies old, the post new implies post old
Postconditions are not all properties.
Postconditions are a strict subset of observable properties; users may rely on any behavior they observe to be true.
post conditions are a very strict subset of the observable properties
Users depend on all observable behavior.
Per Hyrum's Law, with enough users, any system behavior becomes a dependency regardless of the formal contract.
all observable behavior of a system will be dependent on by somebody
Read the original ↗Save to your Sponge
Summarized with Sponge. Quotes are the author’s own words.