And here’s an interesting observation: The API of the socket changes as you move from one state to another.
Anyway, this rant is addressed to programming language designers: What options do we have to support such mutating API at the moment. And can we do better?
It’s called typestate. It’s been tried, and it tends to be cumbersome.
It’s called typestate. It’s been tried, and it tends to be cumbersome.