You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust sort of had a convention that you should document any function that could panic.
In both cases this was never really asserted by the compiler and so wasn't too useful. But I think these are good ideas.
I'm wondering if it would make sense to have a convention in function naming to distinguish functions that assert the result, or don't assert the result. For example assert_equal asserts that two variables are equal and equal returns a boolean.
The text was updated successfully, but these errors were encountered:
Interestingly in ocaml there's a convention that if your function can raise an exception then it should have _exn at the end (e.g. https://ocaml.janestreet.com/ocaml-core/109.20.00/doc/core/List.html)
Rust sort of had a convention that you should document any function that could panic.
In both cases this was never really asserted by the compiler and so wasn't too useful. But I think these are good ideas.
I'm wondering if it would make sense to have a convention in function naming to distinguish functions that assert the result, or don't assert the result. For example
assert_equal
asserts that two variables are equal andequal
returns a boolean.The text was updated successfully, but these errors were encountered: