CSC300 / CSC402: How to write code [1/10] |
The amount of time spent on a function does not amount to much.
Understand the problem!
If you are not working effectively, you can spend months on a single function and never get it correct.
So how do you work efficiently? Key things:
Work out lots of examples before you try to code.
Work on paper before you write any code.
Write automated tests to tell you whether you got it right.
Break the problem down into pieces -- work incrementally.