Karatancheva wrote:Well, it is a mess because the problem I was set was very difficult to solve - I had to jump right in to try different ways of approaching the problem. Writing clean code at this point was my least priority.
Thanks for the responses and link to ultra edit.
When you've been at this a while you'll learn that half the problem is your approach.
'I had to jump right in...' Well yes hacking around and prototyping to clarify your understanding is very usefull, but only to help you understand the problem. Then you have to stop and think about it. Writing live code is the LAST thing you do once you have designed the solution. Indeed, it real world production programming writing code is only 10% of the job, the first 40% is analysing the problem and designing the solution, and the last 50% is testing and documenting whast you've written.
Writing dirty code just makes it more difficult all along the way. Your logic is not clear, and so debugging is that much more difficult. Without a clear solution design, you are not certain of where you are at any stage of the process.
It is fundamental in any engineering field that big problems are best solved by breaking them down into small problems. You can compartmentalise the parts, solve one problem, test it and then move on to the next small problem. Changes in one area do not impact on everything else.