Hacker News new | past | comments | ask | show | jobs | submit login

Rough rule of thumb that works wonders:

Write/modify code.

Run program and/or ensure that codepath is executed.

Did it do what you intended?

If yes, figure out what's wrong about it, fix it, retry.

If no, move on to next item on your agenda. (Possibly first doing a quick refactor to improve readability, etc.)




If you refactor you should always retest. I've lost track of the number of times things have been broken by someone tweaking things to make them better.


The flip side of this is that you can do deep refactoring with more confidence if you have thorough test coverage (and/or a smart type system).




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: