about thinking through first, and then coding.
Sometimes that fails though, but after some experience you start understading what it means.
For example, we were to write a 2-pass compiler. This should scream right away for functions like "pass1()" and "pass2()". I missed it, and was coding something else, even though I thought that I thought about the problem. I did have these functions, but they weren't as separated from each other as I'd liked them to be. i.e. I think I had to accomodate things for pass1 and pass2 elsewhere in the program, while it should've been done in pass1 or pass2.
What I mean is, with experience you get better and better at writing code, and writing consice modules that do one job and do it good. Thinking about the problem helps, but experienced thinking helps better :)
|