3 ms·
The twice-implemented requirement mentioned near the start of this article seems to have the potential for being the basis of an informative case study, but thi
by mannykannot 9y ago
The twice-implemented requirement mentioned near the start of this article seems to have the potential for being the basis of an informative case study, but this was not it - instead, it is just another article pontificating over the minutiae of syntax (the linked article may have a more informative analysis, but the link seems to be broken.)
At one point, we read "your abstractions should afford the right behaviours whilst make it impossible to do the wrong thing." Well, that would undoubtedly be helpful, but Turing may want to have a word with you about the feasibility of guaranteeing it. What does F# do in this regard? We are told it does not have nulls, which is nice, but what does it do to avoid someone introducing data that are semantically, rather than formally, null values (NaN, for example?)
The section on testing does not seem to contain anything that is F#-specific. it mentions QuickCheck, but that has apparently been implemented for many imperative languages, including C#. Is this sort of thing more effective for functional languages? There is no discussion of the possibility here.
I am actually persuaded that there are benefits to functional programming, but articles like this paradoxically give the impression that there is not much substance behind the large claims.
The first thing I would like to know about the case study was whether the implementers of one version benefitted from the problems encountered by those of the other, especially with regard to getting the requirements nailed down.
- brians 9y agoTuring hardly prevents it; indeed, by the Church-Turing thesis, shows us how it’s done: write an abstract model of your problem space. This is your types and type functions (like Option/Some/Maybe). Write a type that is the theorem claiming you get your output from your input. Now you guarantee you cannot do the wrong thing. Affordances for the right behaviors? Those are library functions you build bottom up, or assemble from a library of structures (functor, monad, etc.) and your types. As all affordances, there are art and craft here. On semantic nulls, the compiler typically enforces completeness on case analysis.
- mannykannot 9y agoYes, I should have scrubbed that paragraph and started over, to say something like eliminating nulls is only part of the problem, and you still have to do everything right, starting with your abstract model of the problem space. With regard to semantic nulls, I offered NaN as an example, but I was thinking of the case where the programmer introduces what is, in practice, a semantic null value for one of his user-defined types - something that should be distinguished as a special case, but isn't.