I tend to use the "try the dumbest thing that could possibly work first" method, then after the concept is proven, I refactor it into good (or varying levels of better) code over the course of a few iterations, until the point where the original does not really exist any more, but it still solves the problem, and has decent tests, logging, and the other things that typically need to be thought about.