Re: The argument for quick hack prototypes in science is very, very weak.
Just because you shouldn't *publish* based on a "quick hack prototype" doesn't mean that it wasn't a useful step in the process or working out the scope of the working version (or whatever you want to call it). Indeed, I have found that trying to write some initial code can even bring unforseen aspects of a problem to light.
And on the more general point, we need to remember that scientific codes cover a very wide range of approaches, from the short to the long, from stand-alone codes to ones that rely heavily on library functions, and ones that vary greatly in the rigour of their design.
One particular thing that does, in my experience, need to be borne in mind when tempted to criticise scientific code is that for a reasonable fraction (I might be inclined to suggest even most), their usage needs to be treated somewhat like chainsaw juggling. To use them, you need to understand what it does, why it does it, what it is intended to represent; and benchmark where possible against non-computational results; and in particular to always be ready stop and to question any and all output for signs of misbehaviour. These are not artifacts that are in anyway designed or intended to be used by the untrained, the uncritical, or the non-specialist.
Otherwise, for what it is worth, and also as a research scientist, I am broadly in agreement with LionelB's comments here.