News for hackers. Stuff that matters.
Re:Nobody cares about your clean code by gfodor on Monday April 26, 2021 @09:36PM (#26950757)
I rarely prototype but the scenarios where I do are in the game engine context where I’m trying to hack together a real time graphics algorithm, meshing algorithm, etc. The difference between a one second and 15 second iteration time is meaningful.
Re:Nobody cares about your clean code by StavrosK on Monday April 26, 2021 @09:43PM (#26950825)
Do you throw that code away and start over when you're done prototyping?
Re:Nobody cares about your clean code by jacobolus on Monday April 26, 2021 @10:03PM (#26951005)
I would recommend you try writing hacky code and then throwing it away and starting from scratch a couple times on the same project idea, just to see how it goes. It might teach you something.

The people I know who regularly take this approach end up with a really fantastic code architecture in the end, and avoid a lot of pitfalls from their first naïve attempts.

Re:Nobody cares about your clean code by mixmastamyk on Tuesday April 27, 2021 @12:24PM (#26958079)
Semantics, but yes in a partial sense.

When dissatisfied with an approach I'll often copy a class/function or three into new versions. I'll append the names of the old with 0. Then I start writing new ones with the new approach. In effect throwing the old ones away, even if sometimes it is a gradual process.

This happens frequently in a new project, less frequently in a maturing project, to never in a maintenance project.

However, it has a lot in common with (a severe) refactoring. Generally you're keeping the "overhead" docs, code, and even files, so it is not a complete rebirth, perhaps ~30% of the core code.