It comes down to why you are writing the code in the first place:
- If the goal is to write code to produce a dataset, the output is what matters. Sometimes you just need to get stuff done and the code is secondary. It's OK to write crap code.
- If the goal is to write code that will be used to repeat the process, possibly in a different context, the code itself is what matters. The abstractions presented by the code are primary and you need to consider all the ways in which it will be used/misused. Crap code is unacceptable.
- If the goal is to write code to produce a dataset, the output is what matters. Sometimes you just need to get stuff done and the code is secondary. It's OK to write crap code.
- If the goal is to write code that will be used to repeat the process, possibly in a different context, the code itself is what matters. The abstractions presented by the code are primary and you need to consider all the ways in which it will be used/misused. Crap code is unacceptable.