2 ms·
I recommend https://open.library.ubc.ca/soa/cIRcle/collections/ubctheses/24/items/1.0428823 https://open.library.ubc.ca/soa/cIRcle/collections/ubctheses... as a
by roguecoder 2y ago
I recommend https://open.library.ubc.ca/soa/cIRcle/collections/ubctheses/24/items/1.0428823 https://open.library.ubc.ca/soa/cIRcle/collections/ubctheses... as a place to start.
It isn't about "guaranteeing" _everything_, any more than assertions or guard clauses guarantee everything. It is about giving programmers a semantic tool they can use to communicate expected interfaces in an automatically-detected way, without adding unnecessary toil and boilerplate in tight, local contexts where functions are just working on obvious primitives.
The most graceful implementation I've seen is RDoc comments + Jetbrains tooling in Ruby. When it looks like a type system people assume it's going to work like Java, but having build-time checks based on where people bothered to describe the expected interface catches errors without any of the downsides of type systems that keep type systems from measurably boosting productivity.