On Monday, 6 June 2022 at 04:59:05 UTC, Ola Fosheim Grøstad wrote:
For instance if a sort function fails, then you can call a slower sort function.

Or in terms of actors/tasks: if one actor-solver fails numerically, then you can recover and use a different actor-solver.

Those are not places where you would put an assert.

The only place to put an assert is when *you* know there is no recovery.

Like you have been arguing, there aren't many places like that.

So don't use it.

---

9 out of 10 times when I see an assert in code review I ask the author to reconsider. Often it only requires a little tweak.

I guess you could say I have found asserts to be misused.
    • Re: Comparing Exceptions... Steven Schveighoffer via Digitalmars-d-learn
      • Re: Comparing Except... kdevel via Digitalmars-d-learn
        • Re: Comparing Ex... Steven Schveighoffer via Digitalmars-d-learn
          • Re: Comparin... Steven Schveighoffer via Digitalmars-d-learn
          • Re: Comparin... kdevel via Digitalmars-d-learn
            • Re: Com... Steven Schveighoffer via Digitalmars-d-learn
              • Re:... kdevel via Digitalmars-d-learn
              • Re:... Steven Schveighoffer via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Sebastiaan Koppe via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Steven Schveighoffer via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Steven Schveighoffer via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... kdevel via Digitalmars-d-learn
  • Re: Comparing Exceptions and ... frame via Digitalmars-d-learn

Reply via email to