this post was submitted on 22 Jul 2023
5 points (85.7% liked)
English usage and grammar
380 readers
1 users here now
A community to discuss and ask questions about English usage and grammar.
If your post refers to a specific English variant, please indicate it within square brackets (for instance [Canadian]
).
Online resources:
- Cambridge English Dictionary
- Merriam-Webster Dictionary and Thesaurus
- Gilman's Webster's Dictionary of English Usage. This is a great and witty reference about usage, its history, and its controveries
Sibling communities:
Rules of conduct:
The usual ones on Lemmy and Mastodon.. In short: be kind or at least respectful, no offensive language, no harassment, no spam.
(Icon: entry "English" in the Oxford English Dictionary, 1933. Banner: page from Chaucer's "The Wife of Bath's Tale".)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Assert is used in programming to test a condition and cause a crash if it fails. They are used for conditions that are unrecoverable and should never happen. Then you have unit test assertions as in the example op gave. Those fail if the asserted fact isn't what you expected. The third way, as in the
assertDataPresent()
example, the implication is that whatever you are asserting must be true. Usually in a method likeassertDataPresent()
it will make certain that the data is present. i.e. it would add it if it wasn't already there. That's how I've mostly seen it used in programming. So under that usage, it is actually closer to the english definition, because it's not just checking, it's ensuring that after the assertion that whatever was being asserted is true.Thank you, I see, it isn't just a check as I understood. Then the meaning does make sense.
I edited my comment to provide more context about the 3 kinds of assert I see in programming.