I can't beleive I'm going to say this,
but I used to do it like Puki says.
Just last night in a coding session I pinpointed some areas of code that were unexcusable due to me just "hacking it in till it worked"- actually, it was transplanted from B3D, but the code in B3D was hacked in.
You can usually replace a 100-line peice of code that was hacked together when you didnt know what you were doing- with a 10-20 line peice of optimised code.
but I used to do it like Puki says.
Just last night in a coding session I pinpointed some areas of code that were unexcusable due to me just "hacking it in till it worked"- actually, it was transplanted from B3D, but the code in B3D was hacked in.
You can usually replace a 100-line peice of code that was hacked together when you didnt know what you were doing- with a 10-20 line peice of optimised code.