From 51b11765888814a0372cb653afb865cc904d447a Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Wed, 5 Jul 2023 17:43:20 +0800 Subject: [PATCH] docs/FSharpStyleGuide: introducing BetterAssert --- docs/FSharpStyleGuide.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/FSharpStyleGuide.md b/docs/FSharpStyleGuide.md index 5e452011..571a8a59 100644 --- a/docs/FSharpStyleGuide.md +++ b/docs/FSharpStyleGuide.md @@ -39,6 +39,9 @@ of using the less safe approaches `x.IsSome && x.Value = ...` or `x.IsNone || x.Value = ...`, which might break easily when refactoring them. * In case of doubt, we prefer to expliticly add the accessibility keywords (`private`, `public`, `internal`...), should the F# language allow it. +* If you want to assert in the main code (that is, not inside automated tests), +please don't use `assert` or `failwith`, rather use +[Fsdk's Misc.BetterAssert](https://github.com/nblockchain/fsx/commit/7acb7a5b8fa374ee2b68c28c2e438cb6c9265e58). * With `if` blocks we prefer to put the `then` keyword in the same line as the `if`, but use a newline afterwards; and the `else` or `elif` keywords indented to be aligned with the `if`. Example: