The Philosopher's Stone (lapis philosophorum) of Programming

The Secret of the Software Arts: Write, Test, and Debug Functions One-at-a-Time.

Please remember to write and test functions one-at-a-time: do not type in several function definitions all at once and then try to compile and debug your program. Add a function definition to a program, compile it and test it; then, when it is working, add the next function definition to the program.

! Resist that impulse to type in 3-4 functions at once and then compile them.
!! Compile and thoroughly test a function before you compile any function that calls it.

EXAMPLE: Suppose rocky() calls bullwinkle().

rocky() won't work correctly until bullwinkle() is correct, so write and test bullwinkle() before going on to write and test rocky().

This approach will save you hours of work, guaranteed.