5 ms·
> But with all that, as Joe Armstrong once jeered, no amount of type checking would catch the following bogus code: It is worth to note that the stated problem
by mulander 4y ago
> But with all that, as Joe Armstrong once jeered, no amount of type checking would catch the following bogus code:
It is worth to note that the stated problem, of accessing a file after it is closed was addressed in the Phd thesis by [1] Joe Armstrong in which he suggested a solution for exactly this problem by introducing a new testing & development methodology he named "protocol checkers" (9.1 Protocols, page 195). Relevant quote from the thesis:
> Given a protocol which is specified in a manner similar to the above
it is possible to write a simple “protocol checking” program which can be
placed between any pair of processes.
The protocol is a state machine, which would detect the attempt to write to a file after it was closed.
[1] - https://erlang.org/download/armstrong_thesis_2003.pdf https://erlang.org/download/armstrong_thesis_2003.pdf
- sidpatil 4y agoAnother term for this is typestate analysis. https://en.wikipedia.org/wiki/Typestate_analysis https://en.wikipedia.org/wiki/Typestate_analysis