Lessons learned these days

1. A server style program must not fail for any reason.

2. It’s not good to put redundant logs as it costs CPU time. But it’s good to leave logs for crucial stuff for debugging purpose.

3. Batch program should fail if one can restart it and monitor it. Otherwise, one can not find that it had some mysterious bug. One can leave ERROR log, but no one will take a look at it until forced.

4. Never catch all exceptions. Catch specific ones. But it’s much better not to use exception at all and use return value for exception handling.

Similar Posts:

Comments 1