Inspired by How do you avoid "Code Burnout"? here is the meditation for initating peace from the beginning. Having worked hard on your project how do you create peace of mind about your code? What you expect of code? What makes you happy? How do you select the priorities. ( add your own) Thus when you write now and look after few days/months/years you should have the sense of fullfilment. You can look at the code to say, that you tried to achieve the 'items' at that time and it still holds true or it is time to get peace of mind about this 'item'. By having proper idea, you can refactor easily if necessary. For example, even if you have spagetti-code but well-commented, it could be less work to make it modular v/s if it was not commented.

Thanks
artist

Replies are listed 'Best First'.
Re: Peace of Mind
by dws (Chancellor) on Jul 01, 2003 at 00:48 UTC
    Having worked hard on your project how do you create peace of mind about your code?

    • Good Unit Tests
    • No loose ends in the code. (All "TBD" or "FIXME" comments addressed and eliminated.)
    • A check, deposited in the bank and cleared.

Re: Peace of Mind
by Anonymous Monk on Jun 30, 2003 at 20:30 UTC

    Well...

    1. Ensure the source will always be available, in the required form, if needed:
      1. Use CVS so you can rollback the code to any point.
      2. Implement proper backup proceedures taking into account everything from media failure to natural disasters.
    2. Ensure problems can be fixed in an acceptable time frame.
      1. Create a modular design.
      2. Clearly specify every aspect of the code.
      3. Document it well (both high-level user docs and comments).
    3. Take steps to prevent problems in the first place:
      1. Design everything in detail first.
      2. If possible, audit and use existing tested code.
      3. Write tests, then code.
      4. Refactor, refactor, refactor.
      5. Refactor.
    4. Remain paranoid.
    5. Pass off maintaining the code.
    6. Peace of mind (until the new maintainer bothers you ;)

    So yeah, if you want peace of mind you'll have to find another job ;-).

Re: Peace of Mind
by thelenm (Vicar) on Jul 01, 2003 at 04:43 UTC

    Most of all, tests! Nothing gives me more absolute peace of mind about my code than doing a make test and watching all the tests pass. If the tests pass, and I can't think of any more tests that might break, then the code is complete and I am happy. If I need to make changes for any reason, the tests will tell me if I accidentally break anything. The more code I write, the more I feel like coding without tests is like flying on a trapeze without a safety net.

    -- Mike

    --
    just,my${.02}

(jeffa) Re: Peace of Mind
by jeffa (Bishop) on Jul 01, 2003 at 15:07 UTC
    One item:
    • hindsight
    If i could look into the future and take knowledge back with me into the present - then i could have peace of mind. Otherwise, it's all up for grabs. Sure, you can design and test and refactor all you want - but that's nothing compared to being able to travel in time and seeing how the project winds up. Then you can make the right choices. Heck! You could just take the finished code back with you! :D

    (ask a silly question, get a silly answer)

    jeffa

    "i prefer Meditations that have some effort put into them"
Re: Peace of Mind
by hsmyers (Canon) on Jul 01, 2003 at 04:00 UTC

    What I want in code is:

    • That it should work!
    • That it should be as easy to use as I can make it.
    • That it should be as economical of space and time as I can craft it.
    Although I will and often have to, settle for the first, I will always want the rest as well.

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."
Re: Peace of Mind
by Courage (Parson) on Jul 03, 2003 at 06:56 UTC
    ... watching favourite cartoon movie ...

    Courage, the Cowardly Dog