Don't you just hate it...
Miscellaneous Forums/General Discussion/Don't you just hate it...
... when you have a very short time to code something quickly and you start and then you realise halfway through that you've made it much more complicated than it should, and you have 3 similar types interacting with each other instead of 1, so there's 9 times as much code for every little function, but at this stage you have no time to fix it properly so you have to wade through it making it even more convoluted when you know it could be so much simpler?
Me too!
I've done that a couple of times, my code gets large and full of stuff that doesnt need to be there, then when I come accross something thats not doing what its suposed to I have to wade back through tons and tons of code that I dont remember even typing. Then I get lost because my function names dont relate to what they do (blames it on coding at 5am) and drag my applicaiton to the recycle bin. Empty the bin and jump into bed, after 40 minutes of lying looking at the ceiling realise what I was doing wrong but of course its too late.
Moral of the story, Dont empty the Recycle Bin! XD
I never delete old projects, I always leave the folder in place. It's suprising how often I go back to old stuff even if it's just to knick a texture or copy paste out a small section of code for adaption.
mrtricks: I've done it loads of times. They key words you used were "code something quickly" inferring you didn't make a plan, and there lies the downfall. When you plan you are essentially doing the code design beforehand (this is the hard bit) and you can work out aha I only need one big object/type and then coding is very easy as it's just following your plan one step at a time.
I always end up oversimplifying things to the point where it becomes so simplified it's impossible to read and hideously ugly. Like reusing variables that aren't named correctly for a particular situation, because it was free and just sitting around not doing anything so I didn't want to create a new variable =]
Then down the track I try and work out exactly why I'm processing ImageFrame[n] in an AI loop.
When you plan you are essentially doing the code design beforehand
I'm not convinced that design up front + implementation is more effective and/or faster than simple solution first + refactoring. Particularly not if you're in a tight spot.
I think Robins issue is more a case of Second System Syndrome, or over engineering, if you will. It'll pass with time.
Vanilla : Yeah I used to do that as in the old days you wanted everthing optimised, remember there were only 3 registers on the C64! Nowawdays clarity is best.
FlameDuck: Even an overview plan should help spot any major problems before you actually waste time coding them. Then yes, refactor as you go along. I kinda do both depending on the situation.
I pretty much work by plunging in with a vague plan and then refactoring as it becomes clear. Although if I was to take on a major project with a clear goal I would do a huge amount of planning. In this case it was a tool I wanted to use in a very short time, so planning was out of the question really - same for testing. It's as if I was making Word simply because I wanted to create one text document. I've got the thing done and it's usable, but if it was a man he would be covered in bandages and plasters and popping pills every hour for the pain. I'm really looking forward to having some free time so I can roll up my sleeves and hack it to pieces and make it the nice neat code it could be.
Mr Tricks...
and then you spend 10 minutes typing on the forum and 30 minutes reading replies...and beofre you know it the day is done!
LOL ;)
IPete2.