
On Mon, 8 Oct 2007, Alistair Bayley wrote:
On 08/10/2007, Henning Thielemann
wrote: You cannot turn any programmer into a disciplined programmer just by giving him a well designed language. I you try so, they will not like to use that language, will leave that language as soon as possible or they try to adapt the language to their style of programming.
Well, I wasn't suggesting you'll create great programmers overnight, but you might expect that their appreciation of good design might improve after some Haskell exposure. Also, Haskell simply doesn't support some of the things that are common causes of errors in the enterprisey-language world. I recall reading something about one of the most common causes of errors in novice programs being type errors (presumably, once they'd got the program to compile i.e. there were no syntactic errors). And I'm under the (possibly mistaken) impression that some of the common errors non-novice programmers make are aliasing bugs, and/or use of global variables. Does anyone have references to studies confirming (or refuting) this?
Thus, what happens today? People ask Haskell-Cafe how to implement global variables and they are advised to use IORefs and unsafePerformIO, although the better answer is: "Why do you want to do this?" Even "Tackling the awkward squad" considers unsafePerformIO an acceptable tool for handling global configuration files.
People who are used to weak typing will use a type like data Number = Int Int | Float Float | ... for numbers, or even String for everything, they will use numbers, where enumerations are more appropriate and so on.
I think that the ease with which you can create a new type in Haskell (and derive useful classes like Enum, Show, etc) makes it more likely that a programmer will use an appropriate domain-specific type, rather than just reuse String, Int, or Float.
I know of popular Haskell libraries which ignore disciplined type design, but I do not want to hurt their authors ...