Skip to content

Comment on Rust's Two Kinds of 'Assert' Make for Better Codeparent

Comments

There's no semantic different between `assert` and `doAssert`.

There is a difference, but I agree that it's very subtle. In english do before a verb adds an emphasis so it's like "assert assert" or "really assert" put in a short easy to type form.

Any subtle difference you might be imagining is completely unrelated to the actual difference between them, and there's absolutely no way you could infer that difference.

They very clearly chose `doAssert` because they already had `assert` and couldn't think of a good name for a second similar-but-different kind of assert.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.