私は、エラー管理の「rc」エラーコード戻りスタイルを好む。これが throw-catch によってより適切に処理される課題を提示することに同意しますが、クリーンで保守可能なスタイルで設計および実装しているとはまだ感じていません。ですから、単なる参考書ではなく、パターンについて論じた良い本を探しています。
参考文献の参考文献もいいでしょう...
以下の回答「アジャイル プログラマーの実践」からの抜粋で、特に印象的でした。
**Keeping Your Balance**
• Determining who is responsible for handling an exception is part of design.
• Not all situations are exceptional.
• Report an exception that has meaning in the context of this code. A NullPointerException is pretty but just as useless as the null object described earlier.
• If the code writes a running debug log, issue a log message when an exception is caught or thrown; this will make tracking them down much easier.
• Checked exceptions can be onerous to work with. No one wants to call a method that throws thirty-one different checked exceptions. That’s a design error: fix it, don’t patch over it.
• Propagate what you can’t handle.