Neatness?

i had embarked on a large project(well for me) to make a game....it failed after about 5 months....it worked but i couldn't read it it was so crapply written. I decided to start over and not let the same mistake happen again. Now to my question when you are writing "experimental code"(code i dont know if will work or not) do you spend the time to make it not ever look bad or just code something then when it works make it look cleaner...i have gone with the 2nd option but want to hear what yall think would be better

Any sugesstions?
Nope, but once I finish it I have a weird obsession to make it as neat as possible.

Not necessarily a good thing, sometimes I don't think about other messy parts.
so you're saying don't but you do anyway?
Eh, hard to explain.
I get things working in parts and re-factor as I go.
When experimenting with new toys, I find it best to start out by writing the simplest code that does what I'm interested in, and expand little by little. Once I'm satisfied with what I've learned, I scrap that code and write a proper interface between the larger application and the new feature.
It's important to understand that, by default, one's nature is to recycle work. Experimental code is bad and kludgy, and if you let it seep into your mainline, it'll never go away.

I'm generally wary of touching code for purely aesthetic reasons. Old ugly code that works is better than new neat broken code. Unless I'm going to completely restructure/reimplement it, I prefer to leave it alone.
I normally work on extremely large project consisting of dozens of source files and naturally with all these source files the features involved\integrated into the project are always quite large and complicated. This raises a issue that should I just test it in the main project itself or create a Test\Experimental sub-project needed much like a research facility which is close part of a armory\weapon factories.
Normally I like create a new project, and test all my "concepts" out there, without disturbing my priority project.

It offers me a sandbox like environment and all my concepts can be tested there thoroughly, do be aware the end product of the concept project (test project) tend to be very crude and not much manual code optimization, from me and can be called "early design" to give you a rough estimate you can imagine when the first aeroplane was created it only flew for 12 seconds before coming down. Now in commercial world the planes can fly for near enough a century.

TD;LR
The concepts are always crude but I develop them in main project to be neat and consistent.
Topic archived. No new replies allowed.