This is a well-discussed concept already - see the concept of "Spikes" in Agile development, or to a lesser extent, the idea of "Tracer Bullets" from The Pragmatic Programmer.
Of course, what's done in practice tends to differ, unfortunately.
I like Fred George's developer anarchy in this regard - especially the concept of micro-web-services. they are the equivalent of a unix command - do one thing (well) and join up with MQ. if you make a service small enough you can be confident of putting it up as a prototype and rewrite it next weekend in node.js
I always did this, it's just how I code. Trick is to keep them short and fixed duration under a day, preferably under half. a) that's where all the value is (longer and you're just going down the rabbit hole), and b) gives you time to quickly write production code based on the spike/prototype.
Of course, what's done in practice tends to differ, unfortunately.